Documentation ¶
Index ¶
- type CurrentDb
- type CurrentElastic
- type CurrentRedis
- func (d *CurrentRedis) Expire(ctx context.Context, key string, time time.Duration)
- func (d *CurrentRedis) ExpireAt(ctx context.Context, key string, time time.Time)
- func (d *CurrentRedis) Get(ctx context.Context, key string) (string, error)
- func (d *CurrentRedis) GetInt(ctx context.Context, key string) (int, error)
- func (d *CurrentRedis) HDel(ctx context.Context, key, field string) (int64, error)
- func (d *CurrentRedis) HGet(ctx context.Context, key, field string) (string, error)
- func (d *CurrentRedis) HGetAll(ctx context.Context, key string) (map[string]string, error)
- func (d *CurrentRedis) HGetInt(ctx context.Context, key, field string) (int, error)
- func (d *CurrentRedis) HInc(ctx context.Context, key, field string, value int64) (int64, error)
- func (d *CurrentRedis) HSet(ctx context.Context, key, field string, value interface{}) (int64, error)
- func (d *CurrentRedis) HSetNX(ctx context.Context, key, field string, value interface{}) (bool, error)
- func (d *CurrentRedis) Inc(ctx context.Context, key string, value int64) (int64, error)
- func (d *CurrentRedis) OK() bool
- func (d *CurrentRedis) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) (string, error)
- func (d *CurrentRedis) SetEX(ctx context.Context, key string, value interface{}, expiration time.Duration) (string, error)
- func (d *CurrentRedis) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) (bool, error)
- func (d *CurrentRedis) Warning(r *perf.RunTime, err error)
- type Dao
- func (d *Dao) ClusterRedisClient(opts ...commonoption.Option) (*goredis.ClusterClient, error)
- func (d *Dao) ClusterRedisClientV2(opts ...commonoption.Option) (*goredis.ClusterClient, string, error)
- func (d *Dao) Condition(ctx context.Context, data interface{}, call db.ConditionCallback, ...) result.Result
- func (d *Dao) DBClient(opts ...commonoption.Option) (*gorm.DB, error)
- func (d *Dao) DBClientV2(opts ...commonoption.Option) (*gorm.DB, string, error)
- func (d *Dao) ElasticClient(opts ...commonoption.Option) (*elastic.Client, error)
- func (d *Dao) ElasticClientV2(opts ...commonoption.Option) (*elastic.Client, string, error)
- func (d *Dao) IsNotFound(db *gorm.DB) int
- func (d *Dao) RedisClient(opts ...commonoption.Option) (*goredis.Client, error)
- func (d *Dao) RedisClientV2(opts ...commonoption.Option) (*goredis.Client, string, error)
- func (d *Dao) SentinelRedisClient(opts ...commonoption.Option) (*goredis.SentinelClient, error)
- func (d *Dao) SentinelRedisClientV2(opts ...commonoption.Option) (*goredis.SentinelClient, string, error)
- func (d *Dao) UseDB(opts ...commonoption.Option) CurrentDb
- func (d *Dao) UseElastic(opts ...commonoption.Option) CurrentElastic
- func (d *Dao) UseRedis(opts ...commonoption.Option) CurrentRedis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CurrentElastic ¶ added in v1.8.26
type CurrentElastic struct { *elastic.Client Name string }
func (*CurrentElastic) OK ¶ added in v1.8.26
func (d *CurrentElastic) OK() bool
type CurrentRedis ¶ added in v1.8.26
func (*CurrentRedis) OK ¶ added in v1.8.26
func (d *CurrentRedis) OK() bool
type Dao ¶
type Dao struct { Sql db.SqlDatabase Redis redis.Client Elastic db.EsDatabase }
Dao https://gorm.io/docs/query.html
func (*Dao) ClusterRedisClient ¶ added in v1.1.23
func (d *Dao) ClusterRedisClient(opts ...commonoption.Option) (*goredis.ClusterClient, error)
func (*Dao) ClusterRedisClientV2 ¶ added in v1.22.10
func (d *Dao) ClusterRedisClientV2(opts ...commonoption.Option) (*goredis.ClusterClient, string, error)
func (*Dao) Condition ¶
func (d *Dao) Condition(ctx context.Context, data interface{}, call db.ConditionCallback, opts ...commonoption.Option) result.Result
func (*Dao) DBClientV2 ¶ added in v1.22.10
func (*Dao) ElasticClient ¶ added in v1.0.60
func (d *Dao) ElasticClient(opts ...commonoption.Option) (*elastic.Client, error)
func (*Dao) ElasticClientV2 ¶ added in v1.22.10
func (d *Dao) ElasticClientV2(opts ...commonoption.Option) (*elastic.Client, string, error)
func (*Dao) RedisClient ¶ added in v1.0.60
func (*Dao) RedisClientV2 ¶ added in v1.22.10
func (*Dao) SentinelRedisClient ¶ added in v1.1.23
func (d *Dao) SentinelRedisClient(opts ...commonoption.Option) (*goredis.SentinelClient, error)
func (*Dao) SentinelRedisClientV2 ¶ added in v1.22.10
func (d *Dao) SentinelRedisClientV2(opts ...commonoption.Option) (*goredis.SentinelClient, string, error)
func (*Dao) UseElastic ¶ added in v1.8.26
func (d *Dao) UseElastic(opts ...commonoption.Option) CurrentElastic
func (*Dao) UseRedis ¶ added in v1.8.26
func (d *Dao) UseRedis(opts ...commonoption.Option) CurrentRedis
Click to show internal directories.
Click to hide internal directories.