otp

package
v0.9.16 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeGenerator

type CodeGenerator func() int

type Config

type Config struct {
	TTL time.Duration
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(cfg *Config, codeGen CodeGenerator, store key_value.IKeyValue) *Service

func (*Service) InitCode

func (s *Service) InitCode(ctx context.Context, identifier, purpose string) (int, error)

func (*Service) SetHashKeyFunc

func (s *Service) SetHashKeyFunc(f func(code int, identifier, purpose string) string)

func (*Service) VerifyCode

func (s *Service) VerifyCode(ctx context.Context, code int, identifier, purpose string) error

Jump to

Keyboard shortcuts

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