Documentation ¶
Index ¶
- Constants
- Variables
- func Decode(data []byte, to interface{}) error
- func DelCache(key string) error
- func Encode(data interface{}) ([]byte, error)
- func GenInviteCode(id int64) string
- func GetCache(key string, to interface{}) error
- func GetCpt() *captcha.Captcha
- func GetSiteConfigCodeMap() map[string]string
- func InitCache()
- func InitCaptcha()
- func InitMail(s string, h string, p int, u string, pw string)
- func ReverseInviteCode(ic string) int64
- func SendMailVerifyCode(to string) error
- func SendSmsVerifyCode(sender SmsSender) (string, error)
- func SetCache(key string, value interface{}, timeoutSecond int) error
- func VerifyMailVerifyCode(key string, vc string) bool
- func VerifySmsVerifyCode(mobile string, vc string) bool
- type MailSender
- type SmsSender
Constants ¶
View Source
const ( Scname = "NAME" Sccompanyname = "COMPANY_NAME" Sccompanyaddress = "COMPANY_ADDRESS" Sccompanyconcattel = "COMPANY_CONCAT_TEL" Sccompanyconcatqq = "COMPANY_CONCAT_QQ" Sccompanyconcatwx = "COMPANY_CONCAT_WX" Scsmssignname = "sms_signname" Scsmsapi = "sms_api" Scsmsuid = "sms_uid" Scsmskey = "sms_key" Scfrontregsmsverify = "front_reg_sms_verify" ScBaiduApiKey = "baidu_api_key" ScBaiduSecretKey = "baidu_secret_key" ScAliyunAccessKeyId = "aliyun_access_key_id" ScAliyunAccessKeySecret = "aliyun_access_key_secret" ScAliyunAuthSecret = "aliyun_auth_secret_" // 阿里云认证服务的秘钥,每个App不同,添加后缀 App编号,如:aliyun_auth_secret_s )
站点配置code
View Source
const ( CODE_OK = 1 CODE_NEED_LOGIN = 11 CODE_ERROR = 21 )
View Source
const ( PayTypeAlipay = "alipay" PayTypeWechatPay = "wechatpay" PayTypeApplePay = "applepay" )
View Source
const (
AppChannelWxa = "wxa" // 微信小程序
)
Variables ¶
View Source
var SiteConfigCodeMap = map[string]string{ "DIY": "自定义", Scname: "站点名称", }
Functions ¶
func GetSiteConfigCodeMap ¶
func InitCaptcha ¶
func InitCaptcha()
func VerifyMailVerifyCode ¶
func VerifySmsVerifyCode ¶
Types ¶
type MailSender ¶
type MailSender struct { //From string // 发件人,可空,为空时取app.conf中的配置 To []string // 收件人列表,不可空 Cc string // 抄送,可空 Subject string // 主题,可空,默认:无主题 Body string // 内容,内容,不可空 Attach string // 附件,可空 }
func (*MailSender) SendSeparate ¶
func (this *MailSender) SendSeparate() (int, error)
拆分收件人,一人发送一次;返回成功发送数量
Click to show internal directories.
Click to hide internal directories.