Versions in this module Expand all Collapse all v0 v0.0.2 Apr 10, 2024 v0.0.1 Apr 10, 2024 Changes in this version + type ESClient struct + Client *elastic.Client + func NewESClient(ctx context.Context, conf ESConf) (*ESClient, error) + type ESConf struct + Host string + Password string + Port int + User string + type EmailClient struct + func NewEmailClient(ctx context.Context, conf EmailConf) *EmailClient + func (ec *EmailClient) Send(desEmails []string, subject string, content []byte) error + type EmailConf struct + FromEmail string + SMTPPort int + SMTPServer string + SMTPVerifyCode string + type Memory struct + func NewMemory() *Memory + func (mem *Memory) Delete(key string) error + func (mem *Memory) Get(key string) interface{} + func (mem *Memory) IsExist(key string) bool + func (mem *Memory) Set(key string, val interface{}, timeout *time.Duration) + type MongoClient struct + DB *mongo.Database + func NewMongoClient(ctx context.Context, conf MongoConf) (*MongoClient, error) + type MongoConf struct + ConnectTimeout int + Database string + Host string + Password string + ReplSetName string + Username string + type RedisClient struct + Client *redis.Client + func NewRedisClient(ctx context.Context, conf RedisConf) (*RedisClient, error) + func (rd *RedisClient) Del(key string) (int64, error) + func (rd *RedisClient) DelAll(keys ...string) (int64, error) + func (rd *RedisClient) Get(key string) (string, error) + func (rd *RedisClient) HDel(key, field string) (int64, error) + func (rd *RedisClient) HDelAll(key string, fields ...string) (int64, error) + func (rd *RedisClient) HGet(key, field string) (string, error) + func (rd *RedisClient) HSet(key string, values ...interface{}) error + func (rd *RedisClient) Set(key string, val interface{}, expire int) error + type RedisConf struct + Addr string + DB int + DialTimeout int + Password string + PoolTimeout int + ReadTimeout int + WriteTimeout int + type TXSMSClient struct + Client *sms.Client + SdkAppID string + SignName string + TemplateID string + func NewTXSMSClient(conf TencentSMSConf) (*TXSMSClient, error) + func (sc *TXSMSClient) SendShortMessage(contentArr, phoneNums []string) (bool, error) + type TencentSMSConf struct + Host string + Region string + SdkAppID string + SecretID string + SecretKey string + SmsVerifyCode smsVerifyCode