mobileCode

package
v2.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MobilePrivate

func MobilePrivate(mobile string) (b bool, text string)

手机号隐私化

func MobileValidate

func MobileValidate(mobile string) bool

验证一个手机号

func RandCode

func RandCode(len int) string

获取随机验证码

Types

type ForMemory added in v2.1.5

type ForMemory struct {
	Store *memoryStore.MemoryStore
}

func (ForMemory) Del added in v2.1.5

func (f ForMemory) Del(key string) error

func (ForMemory) Get added in v2.1.5

func (f ForMemory) Get(key string) (string, error)

func (ForMemory) Set added in v2.1.5

func (f ForMemory) Set(key, value string) error

type ForRedis added in v2.1.5

type ForRedis struct {
	TagPrefix string
	Expire    time.Duration
	Store     *redis.Client
}

func (ForRedis) Del added in v2.1.5

func (f ForRedis) Del(key string) error

func (ForRedis) Get added in v2.1.5

func (f ForRedis) Get(key string) (string, error)

func (ForRedis) Set added in v2.1.5

func (f ForRedis) Set(key, value string) error

type MobileCode

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

func New

func New(storage mobileCodeInterface) *MobileCode

func (*MobileCode) Del

func (m *MobileCode) Del(mobile string) error

删除

func (*MobileCode) IsCheck

func (m *MobileCode) IsCheck(ms MobileMes) bool

是否正确

func (*MobileCode) IsExist added in v2.1.0

func (m *MobileCode) IsExist(mobile string) bool

是否存在

func (*MobileCode) Send

func (m *MobileCode) Send(sendFunc func() (MobileMes, error)) error

发送

type MobileMes

type MobileMes struct {
	Mobile string
	Code   string
}

Jump to

Keyboard shortcuts

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