redis

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 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 Close

func Close() error

* * Close redis connection * @return error *

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 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)

* * Load redis connection * @return (*Conn, error) *

func (*Conn) Clear

func (c *Conn) Clear(match string)

Clear method to use in cache

func (*Conn) Del

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

* * Del method to use in cache * @param key string * @return bool *

func (*Conn) Empty added in v0.0.3

func (c *Conn) Empty()

Empty method to use in cache

func (*Conn) Get

func (c *Conn) Get(key string, def string) (string, error)

* * Get method to use in cache * @param key string * @param def string * @return string * @return error *

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) More added in v0.0.3

func (c *Conn) More(key string, expiration time.Duration) int64

* * More method to use in cache * @param key string * @param expiration time.Duration * @return int *

func (*Conn) Set

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

* * Set method to use in cache * @param key string * @param value string * @param expiration time.Duration * @return string *

func (*Conn) Type

func (c *Conn) Type() string

* * Type return the type of connection * @return string *

func (*Conn) Values

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

Values method to use in cache

Jump to

Keyboard shortcuts

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