Skip to content

Commit

Permalink
Rename moths-package to token
Browse files Browse the repository at this point in the history
  • Loading branch information
Mobilpadde committed Mar 7, 2023
1 parent 3ee4b6c commit 6105848
Show file tree
Hide file tree
Showing 26 changed files with 25 additions and 24 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ Check out [`main.go`](main.go) for an example
## future 🔮
- Rename `moth` to something better (`OTP` / `Token`)
- ~~Rename `moth` to something better (`OTP` / `Token`)~~
- TODO: Add commit here
- Add better documentation 🫢
- Rename the `gen`-variable to `totp`
- This means renaming the [`otp`](moths/otp)-package as well (`totp`)?
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"github.com/Mobilpadde/moths/v4/moths"
"github.com/Mobilpadde/moths/v4/moths/emojies"
"github.com/Mobilpadde/moths/v4/token/emojies"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions moths/checks/checks.go → token/checks/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package checks
import (
"time"

"github.com/Mobilpadde/moths/v4/moths/emojies"
"github.com/Mobilpadde/moths/v4/moths/errs"
"github.com/Mobilpadde/moths/v4/token/emojies"
"github.com/Mobilpadde/moths/v4/token/errs"
)

func CheckSecret(secret string) error {
Expand Down
4 changes: 2 additions & 2 deletions moths/checks/checks_test.go → token/checks/checks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"
"time"

"github.com/Mobilpadde/moths/v4/moths/emojies"
"github.com/Mobilpadde/moths/v4/moths/errs"
"github.com/Mobilpadde/moths/v4/token/emojies"
"github.com/Mobilpadde/moths/v4/token/errs"
"github.com/enescakir/emoji"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions moths/new.go → token/new.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package moths
package token

import (
"time"

"github.com/Mobilpadde/moths/v4/moths/checks"
"github.com/Mobilpadde/moths/v4/token/checks"
)

func NewMoths(opts ...option) (*Moths, error) {
Expand Down
6 changes: 3 additions & 3 deletions moths/new_test.go → token/new_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package moths
package token

import (
"errors"
"strings"
"testing"
"time"

"github.com/Mobilpadde/moths/v4/moths/emojies"
"github.com/Mobilpadde/moths/v4/moths/errs"
"github.com/Mobilpadde/moths/v4/token/emojies"
"github.com/Mobilpadde/moths/v4/token/errs"
)

func TestNewMoths(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions moths/next.go → token/next.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package moths
package token

import (
"crypto/hmac"
Expand All @@ -8,7 +8,7 @@ import (
"math"
"time"

"github.com/Mobilpadde/moths/v4/moths/otp"
"github.com/Mobilpadde/moths/v4/token/otp"
)

func (m *Moths) Next() (otp.OTP, error) {
Expand Down
4 changes: 2 additions & 2 deletions moths/next_test.go → token/next_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package moths
package token

import (
"strings"
"testing"
"time"

"github.com/Mobilpadde/moths/v4/moths/emojies"
"github.com/Mobilpadde/moths/v4/token/emojies"
)

func TestNextAndValidate(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions moths/options.go → token/options.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package moths
package token

import (
"encoding/base64"
"time"

"github.com/Mobilpadde/moths/v4/moths/checks"
"github.com/Mobilpadde/moths/v4/moths/emojies"
"github.com/Mobilpadde/moths/v4/token/checks"
"github.com/Mobilpadde/moths/v4/token/emojies"
)

type Moths struct {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion moths/otp/config.go → token/otp/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package otp

import (
"github.com/Mobilpadde/moths/v4/moths/emojies"
"github.com/Mobilpadde/moths/v4/token/emojies"
)

type OTP struct {
Expand Down
2 changes: 1 addition & 1 deletion moths/otp/new.go → token/otp/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"math/bits"
"strings"

"github.com/Mobilpadde/moths/v4/moths/emojies"
"github.com/Mobilpadde/moths/v4/token/emojies"
)

const EmojiBytes = 4
Expand Down
2 changes: 1 addition & 1 deletion moths/otp/new_test.go → token/otp/new_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package otp
import (
"testing"

"github.com/Mobilpadde/moths/v4/moths/emojies"
"github.com/Mobilpadde/moths/v4/token/emojies"
)

func TestNewOTP(t *testing.T) {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion moths/otp/validate_test.go → token/otp/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package otp
import (
"testing"

"github.com/Mobilpadde/moths/v4/moths/emojies"
"github.com/Mobilpadde/moths/v4/token/emojies"
)

func TestValidate(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions moths/validate.go → token/validate.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package moths
package token

import (
"github.com/Mobilpadde/moths/v4/moths/otp"
"github.com/Mobilpadde/moths/v4/token/otp"
)

func (m *Moths) Validate(moth string) bool {
Expand Down

0 comments on commit 6105848

Please sign in to comment.