Documentation ¶
Index ¶
- type ESClient
- type ESConf
- type EmailClient
- type EmailConf
- type Memory
- type MongoClient
- type MongoConf
- type RedisClient
- 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
- type TXSMSClient
- type TencentSMSConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ESClient ¶
type ESClient struct { Client *elastic.Client // contains filtered or unexported fields }
type EmailClient ¶
type EmailClient struct {
// contains filtered or unexported fields
}
func NewEmailClient ¶
func NewEmailClient(ctx context.Context, conf EmailConf) *EmailClient
type Memory ¶
Memory mem cache struct
type MongoClient ¶
func NewMongoClient ¶
func NewMongoClient(ctx context.Context, conf MongoConf) (*MongoClient, error)
type MongoConf ¶
type MongoConf struct { Host string `json:"host" mapstructure:"host"` Database string `json:"database" mapstructure:"database"` Username string `json:"username" mapstructure:"username"` Password string `json:"password" mapstructure:"password"` ConnectTimeout int `json:"connectTimeout" mapstructure:"connectTimeout"` ReplSetName string `json:"replSetName" mapstructure:"replSetName"` }
type RedisClient ¶
type RedisClient struct { Client *redis.Client // contains filtered or unexported fields }
func NewRedisClient ¶
func NewRedisClient(ctx context.Context, conf RedisConf) (*RedisClient, error)
func (*RedisClient) HDelAll ¶
func (rd *RedisClient) HDelAll(key string, fields ...string) (int64, error)
func (*RedisClient) HSet ¶
func (rd *RedisClient) HSet(key string, values ...interface{}) error
type RedisConf ¶
type RedisConf struct { Addr string `json:"addr" mapstructure:"addr"` Password string `json:"password" mapstructure:"password"` DB int `json:"db" mapstructure:"db"` DialTimeout int `json:"dialTimeout" mapstructure:"dialTimeout"` WriteTimeout int `json:"writeTimeout" mapstructure:"writeTimeout"` ReadTimeout int `json:"readTimeout" mapstructure:"readTimeout"` PoolTimeout int `json:"poolTimeout" mapstructure:"poolTimeout"` }
type TXSMSClient ¶
type TXSMSClient struct { Client *sms.Client `json:"clients"` SignName string `json:"signName"` TemplateID string `json:"templateID"` SdkAppID string `json:"sdkAppID"` }
func NewTXSMSClient ¶
func NewTXSMSClient(conf TencentSMSConf) (*TXSMSClient, error)
func (*TXSMSClient) SendShortMessage ¶
func (sc *TXSMSClient) SendShortMessage(contentArr, phoneNums []string) (bool, error)
type TencentSMSConf ¶
type TencentSMSConf struct { SecretID string `json:"secretID" mapstructure:"secretID"` SecretKey string `json:"secretKey" mapstructure:"secretKey"` SdkAppID string `json:"sdkAppID" mapstructure:"sdkAppID"` Host string `json:"host" mapstructure:"host"` Region string `json:"region" mapstructure:"region"` SmsVerifyCode smsVerifyCode `json:"smsVerifyCode" mapstructure:"smsVerifyCode"` }
Click to show internal directories.
Click to hide internal directories.