redisdb

package
v0.0.0-...-0d658de Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client *redis.Client
View Source
var ConnectString string = "redis"
View Source
var Port string = "6379"

Functions

func CreateDataInfo

func CreateDataInfo(rdb redis.Pipeliner, ctx context.Context, key string)

func Exists

func Exists(database Nodedatabase, key string, field string) (exists bool, err error)

func Health

func Health() (string, error)

func New

func New(dababaseName Nodedatabase) (Client *redis.Client, err error)

* * @param: Addr {string}: o nome redis é a referencia para o container do redis. Deve-se trocar 127.0.0.7 pelo nome do container

func UpdateDataInfo

func UpdateDataInfo(rdb redis.Pipeliner, ctx context.Context, key string)

func UpdateDataStatus

func UpdateDataStatus(rdb redis.Pipeliner, ctx context.Context, key string, status status.Status)

Types

type DataInfo

type DataInfo struct {
	Status    status.Status `json:"status,omitempty" redis:"status,omitempty"`
	CreatedAt string        `json:"created_at,omitempty" redis:"created_at,omitempty"`
	UpdatedAt string        `json:"updated_at,omitempty" redis:"updated_at,omitempty"`
}

func GetDataInfo

func GetDataInfo(database Nodedatabase, key string) (dataInfo *DataInfo, err error)

type Nodedatabase

type Nodedatabase int
const (
	Bridge             Nodedatabase = 0
	UserDatabase       Nodedatabase = 1
	PermissionDatabase Nodedatabase = 1
	AddressDatabase    Nodedatabase = 1
	AccountDatabase    Nodedatabase = 1
	ProductDatabase    Nodedatabase = 2
	CategoryDatabase   Nodedatabase = 2
	ShopCartDatabase   Nodedatabase = 2
	FreightDatabase    Nodedatabase = 2
)

Jump to

Keyboard shortcuts

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