rcache

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

README

rose-cache

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(ctx context.Context, minute int64) (*Cache, error)

NewCache returns a new instance of the Cache struct.

func (*Cache) Close added in v0.0.2

func (c *Cache) Close()

func (*Cache) Delete

func (c *Cache) Delete(key string) error

Delete removes a value from the cache using the provided key.

func (*Cache) Get

func (c *Cache) Get(key string) ([]byte, error)

Get retrieves a value from the cache using the provided key.

func (*Cache) GetString

func (c *Cache) GetString(key string) (string, error)

GetString retrieves a value from the cache using the provided key and returns it as a string.

func (*Cache) GetValue

func (c *Cache) GetValue(key string, value interface{}) error

GetValue retrieves a value from the cache using the provided key.

func (*Cache) Has added in v0.0.2

func (c *Cache) Has(key string) bool

func (*Cache) Set

func (c *Cache) Set(key string, value []byte) error

Set sets a value in the cache using the provided key and value.

func (*Cache) SetString

func (c *Cache) SetString(key, value string) error

SetString sets a value in the cache using the provided key and value.

func (*Cache) SetValue

func (c *Cache) SetValue(key string, value interface{}) error

SetValue sets a value in the cache using the provided key and value.

Jump to

Keyboard shortcuts

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