dao

package
v1.8.26 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Zlib Imports: 13 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
}

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
}

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
}

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)

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 ...option.Option) (*goredis.ClusterClient, error)

func (*Dao) Condition

func (d *Dao) Condition(ctx context.Context, data interface{}, call db.ConditionCallback, opts ...option.Option) result.Result

func (*Dao) DBClient added in v1.0.60

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

func (*Dao) ElasticClient added in v1.0.60

func (d *Dao) ElasticClient(opts ...option.Option) (*elastic.Client, 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 ...option.Option) (*goredis.Client, error)

func (*Dao) SentinelRedisClient added in v1.1.23

func (d *Dao) SentinelRedisClient(opts ...option.Option) (*goredis.SentinelClient, error)

func (*Dao) UseDB added in v1.8.26

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

func (*Dao) UseElastic added in v1.8.26

func (d *Dao) UseElastic(opts ...option.Option) CurrentElastic

func (*Dao) UseRedis added in v1.8.26

func (d *Dao) UseRedis(opts ...option.Option) CurrentRedis

Directories

Path Synopsis
*
*

Jump to

Keyboard shortcuts

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