utils

package
v0.0.0-...-b787a1b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Recover

func Recover(name string)

Recover default recover

Types

type Bytes

type Bytes uint64

Bytes bytes for yaml decode

func (*Bytes) Bytes

func (bt *Bytes) Bytes() uint64

Bytes bytes count

func (*Bytes) UnmarshalYAML

func (bt *Bytes) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML custom decode bytes

type TOTP

type TOTP struct {
	sync.Mutex
	// contains filtered or unexported fields
}

TOTP time based one time password

func NewTOTP

func NewTOTP(secret string) *TOTP

NewTOTP create time based one time password hasher

func (*TOTP) Gen

func (otp *TOTP) Gen() string

Gen generate otp

func (*TOTP) GenFrom

func (otp *TOTP) GenFrom(t time.Time) string

GenFrom generate otp from time

func (*TOTP) Verify

func (otp *TOTP) Verify(str string) bool

Verify verify otp value

func (*TOTP) VerifyFrom

func (otp *TOTP) VerifyFrom(str string, t time.Time) bool

Verify verify otp value from time

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL