redis

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERR_ENV_REQUIRED      = "Variables de entorno requerida (%s)"
	ERR_NOT_CACHE_SERVICE = "Not cache service"
)

Variables

This section is empty.

Functions

func AllCache

func AllCache(search string, page, rows int) (et.List, error)

Get all keys

func Close

func Close() error

Close method to use in cache

func Del

func Del(key string) (int64, error)

Delete a key

func DelCtx

func DelCtx(ctx context.Context, key string) (int64, error)

Delete a key

func DelVerify

func DelVerify(device string, key string) (int64, error)

Delete a key with a atrib

func Empty

func Empty() error

Empty the cache

func Get

func Get(key, def string) (string, error)

Get a key value

func GetCtx

func GetCtx(ctx context.Context, key, def string) (string, error)

Get a key value

func GetItem

func GetItem(key string) (et.Item, error)

Get a key and item value

func GetItems

func GetItems(key string) (et.Items, error)

Get a key and items value

func GetJson

func GetJson(key string) (et.Json, error)

Get key and json value

func GetVerify

func GetVerify(device string, key string) (string, error)

Get a key with a atrib

func HDel

func HDel(key, atr string) error

Delete a key with a atrib

func HDelCtx

func HDelCtx(ctx context.Context, key, atr string) error

Delete a key

func HGet

func HGet(key string) (map[string]string, error)

Get a key with a map values

func HGetAtrib

func HGetAtrib(key, atr string) (string, error)

Get a key with a atrib value

func HGetCtx

func HGetCtx(ctx context.Context, key string) (map[string]string, error)

Get a key value

func HSet

func HSet(key string, val map[string]string) error

Set a key with a map values

func HSetAtrib

func HSetAtrib(key, atr, val string) error

Set a key with a atrib and a value

func HSetCtx

func HSetCtx(ctx context.Context, key string, val map[string]string) error

Set a key with a value and a duration

func More

func More(key string, second time.Duration) int

Increment a key

func Pub

func Pub(channel string, message interface{}) error

Publish a message to a channel

func PubCtx

func PubCtx(ctx context.Context, channel string, message interface{}) error

Publish a message to a channel with context

func Set

func Set(key, val string, second time.Duration) error

Set a key with a value and a duration

func SetCtx

func SetCtx(ctx context.Context, key, val string, second time.Duration) error

Set a key with a value and a duration

func SetD

func SetD(key, val string) error

Set a key with a value and a day duration

func SetItem

func SetItem(key string, val et.Item, second time.Duration) (et.Item, error)

Set a key and item value

func SetItemD

func SetItemD(key string, val et.Item) (et.Item, error)

Set a key and item value with a day duration

func SetItemM

func SetItemM(key string, val et.Item) (et.Item, error)

Set a key and item value with a month duration

func SetItemW

func SetItemW(key string, val et.Item) (et.Item, error)

Set a key and item value with a week duration

func SetItemY

func SetItemY(key string, val et.Item) (et.Item, error)

Set a key and item value with a year duration

func SetItems

func SetItems(key string, val et.Items, second time.Duration) (et.Items, error)

Set a key and items value

func SetItemsD

func SetItemsD(key string, val et.Items) (et.Items, error)

Set a key and items value with a day duration

func SetItemsM

func SetItemsM(key string, val et.Items) (et.Items, error)

Set a key and items value with a month duration

func SetItemsW

func SetItemsW(key string, val et.Items) (et.Items, error)

func SetItemsY

func SetItemsY(key string, val et.Items) (et.Items, error)

Set a key and items value with a year duration

func SetJson

func SetJson(key string, val et.Json, second time.Duration) (et.Json, error)

Set key and json value

func SetJsonD

func SetJsonD(key string, val et.Json) (et.Json, error)

Set key and json value with a day duration

func SetJsonM

func SetJsonM(key string, val et.Json) (et.Json, error)

Set key and json value with a month duration

func SetJsonW

func SetJsonW(key string, val et.Json) (et.Json, error)

Set key and json value with a week duration

func SetJsonY

func SetJsonY(key string, val et.Json) (et.Json, error)

Set key and json value with a year duration

func SetM

func SetM(key, val string) error

Set a key with a value and a month duration

func SetVerify

func SetVerify(device, key, val string) error

Increment a key with a atrib

func SetW

func SetW(key, val string) error

Set a key with a value and a week duration

func SetY

func SetY(key, val string) error

Set a key with a value and a year duration

func Sub

func Sub(channel string, reciveFn func(interface{}))

Subscribe to a channel

func SubCtx

func SubCtx(ctx context.Context, channel string, reciveFn func(interface{}))

Subscribe to a channel with context

Types

type Conn

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

func Load

func Load() (*Conn, error)

NewCache create new cache

func (*Conn) Clear

func (c *Conn) Clear()

Clear method to use in cache

func (*Conn) Count

func (c *Conn) Count(key string, expiration time.Duration) int

Count method to use in cache

func (*Conn) Del

func (c *Conn) Del(key string) bool

Del method to use in cache

func (*Conn) Get

func (c *Conn) Get(key string, def interface{}) interface{}

Get method to use in cache

func (*Conn) Keys

func (c *Conn) Keys() []string

Keys method to use in cache

func (*Conn) Len

func (c *Conn) Len() int

Len method to use in cache

func (*Conn) Set

func (c *Conn) Set(key string, value interface{}, expiration time.Duration) interface{}

Set method to use in cache

func (*Conn) Type

func (c *Conn) Type() string

Type method to use in cache

func (*Conn) Values

func (c *Conn) Values() []interface{}

Values method to use in cache

Jump to

Keyboard shortcuts

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