cache

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package cache implements a basic redis cache which provides functionality to interact with redis

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisCacher

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

func NewRedisCacher

func NewRedisCacher(redis datastore.Redis) RedisCacher

NewRedisCacher is a factory function that creates and returns an instance of RedisCacher.

func (RedisCacher) Delete

func (r RedisCacher) Delete(key string) error

Delete removes the cached content associated with the given key from Redis.

func (RedisCacher) Get

func (r RedisCacher) Get(key string) ([]byte, error)

Get retrieves the cached content associated with the given key from Redis.

func (RedisCacher) Set

func (r RedisCacher) Set(key string, content []byte, duration time.Duration) error

Set stores the provided content in Redis cache with the given key and duration.

Jump to

Keyboard shortcuts

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