dao

package
v1.3.34 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 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
	Ctx     context.Context
	// 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(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(key string, time time.Duration)

Expire 过多久失效

func (*Dao) ExpireAt added in v1.0.60

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

ExpireAt 在某个时间点过期

func (*Dao) Get added in v1.0.60

func (d *Dao) Get(key string) (string, error)

func (*Dao) GetInt added in v1.0.60

func (d *Dao) GetInt(key string) (int, error)

func (*Dao) HDel added in v1.0.60

func (d *Dao) HDel(key, field string) (int64, error)

func (*Dao) HGet added in v1.0.60

func (d *Dao) HGet(key, field string) (string, error)

func (*Dao) HGetAll added in v1.0.60

func (d *Dao) HGetAll(key string) (map[string]string, error)

func (*Dao) HGetInt added in v1.0.60

func (d *Dao) HGetInt(key, field string) (int, error)

func (*Dao) HInc added in v1.0.60

func (d *Dao) HInc(key, field string, value int64) (int64, error)

func (*Dao) HSet added in v1.0.60

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

func (*Dao) HSetNX added in v1.0.60

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

func (*Dao) Inc added in v1.0.60

func (d *Dao) Inc(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(key string, value interface{}, expiration time.Duration) (string, error)

func (*Dao) SetEX added in v1.0.60

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

func (*Dao) SetNX added in v1.0.60

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

func (*Dao) WithContext added in v1.0.60

func (d *Dao) WithContext(ctx context.Context) *Dao

Directories

Path Synopsis
*
*

Jump to

Keyboard shortcuts

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