dao

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Zlib Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const KCreateDatabase = "CREATE DATABASE IF NOT EXISTS `%s` CHARACTER SET utf8mb4;"

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao struct {
	Sql     db.SqlDatabase
	Redis   redis.Client
	Elastic db.EsDatabase
	// contains filtered or unexported fields
}

Dao https://gorm.io/docs/query.html

func (*Dao) ClusterRedisClient added in v1.1.23

func (d *Dao) ClusterRedisClient() (*goredis.ClusterClient, error)

func (*Dao) Condition

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

func (*Dao) DBClient added in v1.0.60

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

func (*Dao) ElasticClient added in v1.0.60

func (d *Dao) ElasticClient() (*elastic.Client, error)

func (*Dao) Expire added in v1.0.60

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

Expire 过多久失效

func (*Dao) ExpireAt added in v1.0.60

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

ExpireAt 在某个时间点过期

func (*Dao) Get added in v1.0.60

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

func (*Dao) GetInt added in v1.0.60

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

func (*Dao) HDel added in v1.0.60

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

func (*Dao) HGet added in v1.0.60

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

func (*Dao) HGetAll added in v1.0.60

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

func (*Dao) HGetInt added in v1.0.60

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

func (*Dao) HInc added in v1.0.60

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

func (*Dao) HSet added in v1.0.60

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

func (*Dao) HSetNX added in v1.0.60

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

func (*Dao) Inc added in v1.0.60

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

func (*Dao) IsNotFound

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

func (*Dao) RedisClient added in v1.0.60

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

func (*Dao) ResetEsClient added in v1.0.60

func (d *Dao) ResetEsClient()

func (*Dao) ResetRdsClient added in v1.0.60

func (d *Dao) ResetRdsClient()

func (*Dao) SentinelRedisClient added in v1.1.23

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

func (*Dao) Set added in v1.0.60

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

func (*Dao) SetEX added in v1.0.60

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

func (*Dao) SetNX added in v1.0.60

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

Directories

Path Synopsis
*
*

Jump to

Keyboard shortcuts

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