qxDao

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao interface {
	GetDB() *gorm.DB
	Ping() error
	Close() error
	Create(ctx context.Context, tableName string, in interface{}) error
	Delete(ctx context.Context, tableName string, in interface{}, unscoped bool) error
	DeleteIds(ctx context.Context, tableName string, in interface{}, ids []uint, unscoped bool) error
	DeleteWhereAny(ctx context.Context, tableName string, in interface{}, unscoped bool, query interface{}, args ...interface{}) error
	First(ctx context.Context, tableName string, in interface{}, query interface{}, args ...interface{}) error
	Latest(ctx context.Context, tableName string, in interface{}, query interface{}, args ...interface{}) error
	Find(ctx context.Context, tableName string, in interface{}, query interface{}, args ...interface{}) error
	FindAndOrderByInterface(ctx context.Context, tableName string, orderBy string, in interface{}, query interface{}, args ...interface{}) error
	Update(ctx context.Context, tableName string, id uint, updates interface{}) error
	Count(ctx context.Context, tableName string, query interface{}, args ...interface{}) (int64, error)
	FindAndLimit(ctx context.Context, tableName string, limit, offset int, in interface{}, query interface{}, args ...interface{}) error
	FindAndLimitOrder(ctx context.Context, tableName, orderBy string, limit, offset int, in interface{}, query interface{}, args ...interface{}) error
	FindAndLimitAndSortInterface(ctx context.Context, tableName string, in interface{}, orderBy string, offset, limit int32, query interface{}, args ...interface{}) error
	DeleteWhereQuery(ctx context.Context, tableName string, in interface{}, unscoped bool, query interface{}, args ...interface{}) error
	UpdateWhereQuery(ctx context.Context, tableName string, updates interface{}, query interface{}, args ...interface{}) error
}

func NewDao

func NewDao(db *gorm.DB) Dao

type RedisDao

type RedisDao interface {
	GetRD() *redis.Client
	Ping() error
	Close() error
	Set(ctx context.Context, key string, value interface{}) error
	SetEx(ctx context.Context, key string, value interface{}, seconds int) error
	Get(ctx context.Context, key string, value interface{}, expiration time.Duration) (string, error)
	NewWatcher(ctx context.Context, channel string, fn func(msg *redis.Message)) error
	Publish(ctx context.Context, channel string, msg string) error
}

func NewRedisDao

func NewRedisDao(rd *redis.Client) RedisDao

func NewRedisDaoWithRdConfig added in v0.0.40

func NewRedisDaoWithRdConfig(rc *qxStore.RedisConfig) RedisDao

Jump to

Keyboard shortcuts

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