cached

package
v0.0.0-...-1e1a67a Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxFileSize  = 1024 * 1024 * 100
	MaxKeySize   = uint32(1024 * 1024 * 5)
	MaxValueSize = uint64(1024 * 1024 * 50)
	DATABASE     = map[string]*DataCache{}
)

Functions

This section is empty.

Types

type DataCache

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

func Connect

func Connect(path string) (*DataCache, error)

Connect init data service

func (*DataCache) Add

func (data *DataCache) Add(key []byte, value []byte) error

Add object to data

func (*DataCache) Clear

func (data *DataCache) Clear() error

Clear all data

func (*DataCache) Get

func (data *DataCache) Get(key []byte) ([]byte, error)

Get object by key

func (*DataCache) GetList

func (data *DataCache) GetList() (<-chan Item, error)

GetList data

func (*DataCache) Remove

func (data *DataCache) Remove(key []byte) error

Remove object by key

type Item

type Item struct {
	Key   []byte
	Value []byte
}

Jump to

Keyboard shortcuts

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