database

package
v0.0.0-...-fc1dba9 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RedisDisableError = errors.New("redis disable")
)

Functions

func NewMysql

func NewMysql(conf *config.DBConfig) (*gorm.DB, error)

func NewPostgres

func NewPostgres(conf *config.DBConfig) (*gorm.DB, error)

func NewSqlite

func NewSqlite(conf *config.DBConfig) (*gorm.DB, error)

Types

type RedisDB

type RedisDB struct {
	*redis.Client
	// contains filtered or unexported fields
}

func NewRedisClient

func NewRedisClient(conf *config.RedisConfig) (*RedisDB, error)

func (*RedisDB) Endable

func (rdb *RedisDB) Endable() bool

func (*RedisDB) HDel

func (rdb *RedisDB) HDel(key string, fields ...string) error

func (*RedisDB) HGet

func (rdb *RedisDB) HGet(key, field string, obj interface{}) error

func (*RedisDB) HSet

func (rdb *RedisDB) HSet(key, field string, val interface{}) error

Jump to

Keyboard shortcuts

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