redis

package
v0.0.0-...-30833c4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, config *config.Redis) (port.CacheRepository, error)

New creates a new instance of Redis

Types

type Redis

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

*

  • Redis implements port.CacheRepository interface
  • and provides an access to the redis library

func (*Redis) Close

func (r *Redis) Close() error

Close closes the connection to the redis database

func (*Redis) Delete

func (r *Redis) Delete(ctx context.Context, key string) error

Delete removes the value from the redis database

func (*Redis) DeleteByPrefix

func (r *Redis) DeleteByPrefix(ctx context.Context, prefix string) error

DeleteByPrefix removes the value from the redis database with the given prefix

func (*Redis) Get

func (r *Redis) Get(ctx context.Context, key string) ([]byte, error)

Get retrieves the value from the redis database

func (*Redis) Set

func (r *Redis) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error

Set stores the value in the redis database

Jump to

Keyboard shortcuts

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