Documentation ¶
Index ¶
- Variables
- func AesDecryptSimple(crypted []byte, key string, iv string) ([]byte, error)
- func AesEncryptSimple(origData []byte, key string, iv string) ([]byte, error)
- func Base64Decode(str string) (string, error)
- func Base64Encoder(str string) string
- func Compress(files []*os.File, dest string) error
- func CurlGet(url string) ([]byte, error)
- func CurlGetFile(url string, filePath string) error
- func CurlPost(url, params string, types int) ([]byte, error)
- func DeCompress(zipFile, dest string) error
- func Dup(path string)
- func GetSignHex(params map[string]string) string
- func GetSignMd5(params map[string]string) string
- func InitMySql(config DbConfig) error
- func MarkingPicture(filepath, text string) (image.Image, error)
- func Md5(text string) string
- func MonitorSignal()
- func NewLogger(filename, levels string) *zap.Logger
- func SendMail(mailTo []string, subject, nickName string, body string, config MailConnConfig) error
- func WaterMark(img image.Image, markText string) (image.Image, error)
- type DbConfig
- type MailConnConfig
- type ReCAPTCHAResult
- type RedisMethod
- func (r *RedisMethod) Announce(key, s string)
- func (r *RedisMethod) Del(key string)
- func (r *RedisMethod) Do(method string, arg ...interface{}) (reply interface{}, err error)
- func (r *RedisMethod) EXISTS(key string) (int, error)
- func (r *RedisMethod) Expire(key string, num int64) (interface{}, error)
- func (r *RedisMethod) Get(key string) (interface{}, error)
- func (r *RedisMethod) HDel(key, field string) (bool, error)
- func (r *RedisMethod) HGet(key, field string) (interface{}, error)
- func (r *RedisMethod) HIncrBy(key, field string, value int64) (bool, error)
- func (r *RedisMethod) HIncrByFloat(key, field string, value float64) (bool, error)
- func (r *RedisMethod) HKeys(key string) ([]string, error)
- func (r *RedisMethod) Incr(key string) (interface{}, error)
- func (r *RedisMethod) Info() (string, error)
- func (r *RedisMethod) Lpush(key string, value interface{}) (bool, error)
- func (r *RedisMethod) Rpop(key string) (interface{}, error)
- func (r *RedisMethod) SAdd(key string, value string) (bool, error)
- func (r *RedisMethod) SMembers(key string) ([]string, error)
- func (r *RedisMethod) Set(key string, value interface{}, time int64) (bool, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Db *gorm.DB
View Source
var (
SignalChan chan os.Signal
)
Functions ¶
func AesDecryptSimple ¶
解密
func AesEncryptSimple ¶
加密
func CurlGetFile ¶
func GetSignHex ¶
func GetSignMd5 ¶
func MarkingPicture ¶
MarkingPicture for marking picture with text
func MonitorSignal ¶
func MonitorSignal()
Types ¶
type MailConnConfig ¶
type ReCAPTCHAResult ¶
type ReCAPTCHAResult struct { Success bool `json:"success"` ChallengeTs string `json:"challenge_ts"` Hostname string `json:"hostname"` ErrorCodes []string `json:"error-codes"` }
func CheckReCAPTCHA ¶
func CheckReCAPTCHA(ip, response, recaptchaSecret string) (bool, ReCAPTCHAResult, error)
type RedisMethod ¶
type RedisMethod struct { Pool *redis.Pool RedisHost string RedisPort string RedisPassword string RedisDb string RedisMaxIdle int RedisMaxActive int RedisIdleTimeout int }
var RedisClient RedisMethod
func (*RedisMethod) Announce ¶
func (r *RedisMethod) Announce(key, s string)
func (*RedisMethod) Del ¶
func (r *RedisMethod) Del(key string)
func (*RedisMethod) Do ¶
func (r *RedisMethod) Do(method string, arg ...interface{}) (reply interface{}, err error)
func (*RedisMethod) Expire ¶
func (r *RedisMethod) Expire(key string, num int64) (interface{}, error)
func (*RedisMethod) Get ¶
func (r *RedisMethod) Get(key string) (interface{}, error)
func (*RedisMethod) HGet ¶
func (r *RedisMethod) HGet(key, field string) (interface{}, error)
func (*RedisMethod) HIncrBy ¶
func (r *RedisMethod) HIncrBy(key, field string, value int64) (bool, error)
func (*RedisMethod) HIncrByFloat ¶
func (r *RedisMethod) HIncrByFloat(key, field string, value float64) (bool, error)
func (*RedisMethod) Incr ¶
func (r *RedisMethod) Incr(key string) (interface{}, error)
func (*RedisMethod) Info ¶
func (r *RedisMethod) Info() (string, error)
func (*RedisMethod) Lpush ¶
func (r *RedisMethod) Lpush(key string, value interface{}) (bool, error)
func (*RedisMethod) Rpop ¶
func (r *RedisMethod) Rpop(key string) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.