dao

package
v1.22.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2024 License: Zlib Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CurrentDb added in v1.8.26

type CurrentDb struct {
	*gorm.DB
	Name string
}

func (*CurrentDb) OK added in v1.8.26

func (d *CurrentDb) OK() bool

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

type CurrentRedis struct {
	*goredis.Client
	Name string
	// contains filtered or unexported fields
}

func (*CurrentRedis) Expire added in v1.8.26

func (d *CurrentRedis) Expire(ctx context.Context, key string, time time.Duration)

Expire 过多久失效

func (*CurrentRedis) ExpireAt added in v1.8.26

func (d *CurrentRedis) ExpireAt(ctx context.Context, key string, time time.Time)

ExpireAt 在某个时间点过期

func (*CurrentRedis) Get added in v1.8.26

func (d *CurrentRedis) Get(ctx context.Context, key string) (string, error)

func (*CurrentRedis) GetInt added in v1.8.26

func (d *CurrentRedis) GetInt(ctx context.Context, key string) (int, error)

func (*CurrentRedis) HDel added in v1.8.26

func (d *CurrentRedis) HDel(ctx context.Context, key, field string) (int64, error)

func (*CurrentRedis) HGet added in v1.8.26

func (d *CurrentRedis) HGet(ctx context.Context, key, field string) (string, error)

func (*CurrentRedis) HGetAll added in v1.8.26

func (d *CurrentRedis) HGetAll(ctx context.Context, key string) (map[string]string, error)

func (*CurrentRedis) HGetInt added in v1.8.26

func (d *CurrentRedis) HGetInt(ctx context.Context, key, field string) (int, error)

func (*CurrentRedis) HInc added in v1.8.26

func (d *CurrentRedis) HInc(ctx context.Context, key, field string, value int64) (int64, error)

func (*CurrentRedis) HSet added in v1.8.26

func (d *CurrentRedis) HSet(ctx context.Context, key, field string, value interface{}) (int64, error)

func (*CurrentRedis) HSetNX added in v1.8.26

func (d *CurrentRedis) HSetNX(ctx context.Context, key, field string, value interface{}) (bool, error)

func (*CurrentRedis) Inc added in v1.8.26

func (d *CurrentRedis) Inc(ctx context.Context, key string, value int64) (int64, error)

func (*CurrentRedis) OK added in v1.8.26

func (d *CurrentRedis) OK() bool

func (*CurrentRedis) Set added in v1.8.26

func (d *CurrentRedis) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) (string, error)

func (*CurrentRedis) SetEX added in v1.8.26

func (d *CurrentRedis) SetEX(ctx context.Context, key string, value interface{}, expiration time.Duration) (string, error)

func (*CurrentRedis) SetNX added in v1.8.26

func (d *CurrentRedis) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) (bool, error)

func (*CurrentRedis) Warning added in v1.9.28

func (d *CurrentRedis) Warning(r *perf.RunTime, err error)

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) DBClient added in v1.0.60

func (d *Dao) DBClient(opts ...commonoption.Option) (*gorm.DB, error)

func (*Dao) DBClientV2 added in v1.22.10

func (d *Dao) DBClientV2(opts ...commonoption.Option) (*gorm.DB, string, error)

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) IsNotFound

func (d *Dao) IsNotFound(db *gorm.DB) int

func (*Dao) RedisClient added in v1.0.60

func (d *Dao) RedisClient(opts ...commonoption.Option) (*goredis.Client, error)

func (*Dao) RedisClientV2 added in v1.22.10

func (d *Dao) RedisClientV2(opts ...commonoption.Option) (*goredis.Client, string, error)

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) UseDB added in v1.8.26

func (d *Dao) UseDB(opts ...commonoption.Option) CurrentDb

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

Directories

Path Synopsis
*
*

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL