redis

package
v0.0.0-...-77c56fa Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TransactionTable = "transactionTable"
)

Variables

View Source
var (
	TransactionAlreadyExistsError = fmt.Errorf("transactionAlreadyExistsError")
	TransactionNotFoundError      = fmt.Errorf("transactionNotFoundError")
	ChangedKeyErr                 = fmt.Errorf("the key changed at the time of the request")
)

Functions

func Disconnect

func Disconnect() error

func InitRedis

func InitRedis(cfg *RedisConfig) error

Types

type RedisConfig

type RedisConfig struct {
	Host     string
	Port     string
	Password string
	DB       int
}

func LoadRedisConfig

func LoadRedisConfig() (*RedisConfig, error)

type RedisDB

type RedisDB struct {
	// contains filtered or unexported fields
}

func GetCurrRedisDB

func GetCurrRedisDB() (*RedisDB, bool)

func (*RedisDB) CommitTransaction

func (r *RedisDB) CommitTransaction(serverTransactionID uuid.UUID, status metrics.Status) error

func (*RedisDB) DelKey

func (r *RedisDB) DelKey(serverTransactionID uuid.UUID)

func (*RedisDB) ExistsTransaction

func (r *RedisDB) ExistsTransaction(serverTransactionID uuid.UUID) bool

func (*RedisDB) GetTransactionStatus

func (r *RedisDB) GetTransactionStatus(serverTransactionID uuid.UUID, status metrics.Status) (metrics.Status, error)

func (*RedisDB) UpdateStatus

func (r *RedisDB) UpdateStatus(serverTransactionID uuid.UUID, status metrics.Status) error

Jump to

Keyboard shortcuts

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