cache

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrefix

func GetPrefix(prefix Prefix, opts ...string) string

GetPrefix returns the prefix with arguments.

Types

type Cache

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

Cache cache storage for data loader

func NewCache

func NewCache(maxLimit int) (*Cache, error)

NewCache returns a new cache object.

func (*Cache) Load

func (c *Cache) Load(key string, v interface{}) (err error)

Load loads entry from cache an bind it to the v.

func (*Cache) Store

func (c *Cache) Store(key string, entry []byte) (err error)

Store stores a entry to the specific key on cache object.

type Prefix

type Prefix int

Prefix type

const (
	// Data prefixes
	Candles Prefix = iota
	Symbol
	Price
)

Jump to

Keyboard shortcuts

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