data

package
v0.0.0-...-66fcd57 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB

func InitDB(conf config.Config) (*gorm.DB, error)

func InitMysql

func InitMysql(conf config.Config) (*gorm.DB, error)

func InitRedis

func InitRedis(config config.Config) (client redisx.IRedis, err error)

Types

type DB

type DB struct {
	DB *gorm.DB
}

func NewDB

func NewDB() *DB

type Redis

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

func GetRedis

func GetRedis() *Redis

func (Redis) Clear

func (rs Redis) Clear(key string) error

Clear removes all items from the queue.

func (Redis) DecrInt

func (rs Redis) DecrInt(key string, value int64) (int64, error)

func (Redis) Del

func (rs Redis) Del(key string) int64

func (Redis) Dequeue

func (rs Redis) Dequeue(key string, item interface{}) error

func (Redis) Enqueue

func (rs Redis) Enqueue(key string, item interface{}) error

func (Redis) EnqueueWithTTL

func (rs Redis) EnqueueWithTTL(key string, item interface{}, ttl time.Duration) error

EnqueueWithTTL adds an item to the end of the queue with a TTL (time-to-live) value.

func (Redis) Exists

func (rs Redis) Exists(key string) (bool, error)

func (Redis) Get

func (rs Redis) Get(key string) string

func (Redis) GetFloat

func (rs Redis) GetFloat(key string) (float64, error)

func (Redis) GetInt

func (rs Redis) GetInt(key string) (int, error)

func (Redis) GetInt64

func (rs Redis) GetInt64(key string) (int64, error)

func (Redis) GetObject

func (rs Redis) GetObject(key string, v interface{}) error

func (Redis) GetTTL

func (rs Redis) GetTTL(key string) float64

func (Redis) Incr

func (rs Redis) Incr(key string, value interface{}) (interface{}, error)

func (Redis) IncrFloat

func (rs Redis) IncrFloat(key string, value float64) (float64, error)

func (Redis) IncrInt

func (rs Redis) IncrInt(key string, value int64) (int64, error)

func (Redis) Length

func (rs Redis) Length(key string) (int64, error)

Length returns the number of items in the queue.

func (Redis) Peek

func (rs Redis) Peek(key string, item interface{}) error

Peek returns the first item from the queue without removing it.

func (Redis) Publish

func (rs Redis) Publish(data []byte, channel string) error

func (Redis) Scan

func (rs Redis) Scan(key string, count int64) []string

func (Redis) Set

func (rs Redis) Set(key string, value interface{}, ex time.Duration)

func (Redis) SetEx

func (rs Redis) SetEx(key string, t time.Duration)

func (Redis) SetFloat

func (rs Redis) SetFloat(key string, value float64, expiration time.Duration) error

func (Redis) SetInt

func (rs Redis) SetInt(key string, value int64, expiration time.Duration) error

func (Redis) SetNX

func (rs Redis) SetNX(key string, value interface{}, expiration time.Duration) error

func (Redis) SetObject

func (rs Redis) SetObject(key string, value any, expiration time.Duration) error

func (Redis) Subscribe

func (rs Redis) Subscribe(channel string) *redis.PubSub

func (Redis) UserSign

func (rs Redis) UserSign(userID string) error

func (Redis) ZAdd

func (rs Redis) ZAdd(key string, data interface{}) error

func (Redis) ZRange

func (rs Redis) ZRange(key string) []string

Jump to

Keyboard shortcuts

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