cache

package
v0.0.0-...-43ff40c Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Del

func Del(key string) error

func Get

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

func Init

func Init(config *config.Config) error

func Set

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

Types

type Cache

type Cache interface {
	Del(key string) error
	// Get could use buffer/streaming
	Get(key string) ([]byte, error)
	// Set could use buffer/streaming
	Set(key string, value []byte) error
}

Cache could be defined by user

var DefaultCache Cache

type StorageCache

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

func NewStorageCache

func NewStorageCache(db *badger.DB) *StorageCache

func (*StorageCache) Del

func (c *StorageCache) Del(key string) error

func (*StorageCache) Get

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

func (*StorageCache) Set

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

Jump to

Keyboard shortcuts

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