service

package
v0.0.0-...-45a4d88 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCodeSendTooMany = repo.ErrCodeSendTooMany
	ErrCodeVerifyLimit = repo.ErrCodeVerifyLimit
)

Functions

This section is empty.

Types

type CachedEmailCodeService

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

func (*CachedEmailCodeService) Send

func (c *CachedEmailCodeService) Send(ctx context.Context, biz, recipient string) error

func (*CachedEmailCodeService) Verify

func (c *CachedEmailCodeService) Verify(ctx context.Context, biz, recipient, inputCode string) (bool, error)

type CodeServiceOption

type CodeServiceOption func(option *CachedEmailCodeService)

func WithEffectiveTime

func WithEffectiveTime(effectiveTime time.Duration) CodeServiceOption

func WithMaxRetry

func WithMaxRetry(maxRetry int) CodeServiceOption

func WithResendInterval

func WithResendInterval(resendInterval time.Duration) CodeServiceOption

func WithTemplate

func WithTemplate(title string, temp *template.Template) CodeServiceOption

type Service

type Service interface {
	Send(ctx context.Context, biz, recipient string) error
	Verify(ctx context.Context, biz, recipient, inputCode string) (bool, error)
}

func NewCachedEmailCodeService

func NewCachedEmailCodeService(repo repo.CodeRepo, emailSvc email.Service, opts ...CodeServiceOption) Service

Jump to

Keyboard shortcuts

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