Documentation ¶
Index ¶
Constants ¶
View Source
const ( CtxMongoKey = util.CtxKey("ctxMongoKey") HeaderDBKey = "raccMongoDB" )
View Source
const ( CoreDB = "core" UserDB = "user" )
View Source
const (
CtxRedisKey = util.CtxKey("ctxRedisKey")
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EsV7Conf ¶ added in v0.8.0
func (*EsV7Conf) GetIndexByTime ¶ added in v0.9.0
func (*EsV7Conf) GetIndexByTimeRange ¶ added in v0.9.0
type MongoConf ¶
type MongoConf struct { Uri string `yaml:"uri"` User string `yaml:"user"` Pass string `yaml:"pass"` DefaultDB string `yaml:"defaul"` // contains filtered or unexported fields }
func (*MongoConf) NewMongoDBClient ¶
type MongoDBClient ¶
type MongoDBClient interface { GetCoreDB() *mongo.Database GetUserDB() *mongo.Database WithSession(f func(sc mongo.SessionContext) error) error AbortTransaction(sc mongo.SessionContext) error CommitTransaction(sc mongo.SessionContext) error Close() }
func GetCtxMgoDBClient ¶
func GetCtxMgoDBClient(req *http.Request) MongoDBClient
type RedisClient ¶ added in v0.8.0
type RedisClient interface { Close() error Ping() string CountKeys() (int, error) Get(k string) ([]byte, error) Set(k string, v interface{}, exp time.Duration) (string, error) Del(k string) (int64, error) LPush(k string, v interface{}) (int64, error) RPop(k string) ([]byte, error) HMGet(key string, field ...string) []interface{} HMSet(key string, values ...interface{}) error Exists(key string) bool Expired(key string, d time.Duration) (bool, error) }
func GetRedisByReq ¶ added in v0.8.0
func GetRedisByReq(req *http.Request) RedisClient
type RedisConf ¶ added in v0.8.0
func (*RedisConf) NewRedisClient ¶ added in v0.8.0
func (rc *RedisConf) NewRedisClient(ctx context.Context) (RedisClient, error)
Click to show internal directories.
Click to hide internal directories.