Documentation ¶
Index ¶
- func AesDecrypt(cryted string, key string) string
- func AesEncrypt(orig string, key string) string
- func AesSHA256(password string) string
- func GetRedisClient(info RedisInfoConfig) *Redis.Client
- func PKCS7Padding(ciphertext []byte, blocksize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func SessionInit(r *gin.Engine, config SessionInfoConfig)
- func WeChatInitInMemory(config WechatConfig) *miniprogram.MiniProgram
- func WeChatInitInRedis(config WechatConfig, redisConfig RedisInfoConfig) *miniprogram.MiniProgram
- type Fetch
- func (f *Fetch) Get(url string) ([]byte, error)
- func (f *Fetch) GetRaw(url string) (*http.Response, error)
- func (f *Fetch) Init()
- func (f *Fetch) InitUnSafe()
- func (f *Fetch) PostForm(url string, requestData url.Values) ([]byte, error)
- func (f *Fetch) PostFormRaw(url string, requestData url.Values) (*http.Response, error)
- func (f *Fetch) PostJsonForm(url string, requestData map[string]string) ([]byte, error)
- func (f *Fetch) PostJsonFormRaw(url string, requestData map[string]string) (*http.Response, error)
- func (f *Fetch) SkipTlsCheck()
- type MailInfoConfig
- type MailboxConf
- type RedisInfoConfig
- type SessionInfoConfig
- type WechatConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
func AesEncrypt ¶
func GetRedisClient ¶
func GetRedisClient(info RedisInfoConfig) *Redis.Client
func PKCS7Padding ¶
func PKCS7UnPadding ¶
func SessionInit ¶
func SessionInit(r *gin.Engine, config SessionInfoConfig)
func WeChatInitInMemory ¶
func WeChatInitInMemory(config WechatConfig) *miniprogram.MiniProgram
func WeChatInitInRedis ¶
func WeChatInitInRedis(config WechatConfig, redisConfig RedisInfoConfig) *miniprogram.MiniProgram
Types ¶
type Fetch ¶
func (*Fetch) InitUnSafe ¶
func (f *Fetch) InitUnSafe()
func (*Fetch) PostFormRaw ¶
func (*Fetch) PostJsonForm ¶
func (*Fetch) PostJsonFormRaw ¶
func (*Fetch) SkipTlsCheck ¶
func (f *Fetch) SkipTlsCheck()
type MailInfoConfig ¶
type MailInfoConfig struct { // 发件人账号 Sender string // 发件人密码,QQ邮箱这里配置授权码 SPassword string // SMTP 服务器地址, QQ邮箱是smtp.qq.com SMTPAddr string // SMTP端口 QQ邮箱是25 SMTPPort int }
MailInfoConfig 发件人配置
func (MailInfoConfig) SendEmail ¶
func (config MailInfoConfig) SendEmail(message string, mailbox MailboxConf) error
SendEmail 一个message可以是这样的: message := fmt.Sprintf(`<div>
<div> hello </div> </div>`)
type MailboxConf ¶
type MailboxConf struct { // 邮件标题 Title string // 邮件内容 Body string // 收件人列表 RecipientList []string }
MailboxConf 发送邮件内容配置
type RedisInfoConfig ¶
func DefaultRedisConfig ¶
func DefaultRedisConfig() RedisInfoConfig
type SessionInfoConfig ¶
type SessionInfoConfig struct { Driver string Name string SecretKey string RedisConfig RedisInfoConfig }
func DefaultSessionConfig ¶
func DefaultSessionConfig() SessionInfoConfig
type WechatConfig ¶
Click to show internal directories.
Click to hide internal directories.