mobileCode

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

* * @Author: TheLife * @Date: 2020-2-25 9:00 下午

* * @Author: TheLife * @Date: 2020-2-25 9:00 下午

* * @Author: TheLife * @Date: 2020-2-25 9:00 下午

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 MobileCode

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

func New

func New(tag string, redis *redis.Client, expire time.Duration) *MobileCode

func (*MobileCode) Del

func (m *MobileCode) Del(mobile string)

func (*MobileCode) IsCheck

func (m *MobileCode) IsCheck(ms MobileMes) 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