bcache

package
v0.0.0-...-11273d6 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPortion = &Dataset{"*", JsonConverter}
View Source
var JsonConverter = &jsonConverter{}

Functions

func NewKey

func NewKey(keys ...string) string

export

Types

type BuntCache

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

func NewCache

func NewCache(filename string, portions ...Portion) (*BuntCache, error)

export

func NewCacheWithConverter

func NewCacheWithConverter(filename string, converter Converter) (*BuntCache, error)

export

func (*BuntCache) AddPortion

func (bc *BuntCache) AddPortion(portions ...Portion)

func (*BuntCache) CreateJSONIndex

func (bc *BuntCache) CreateJSONIndex(name string, pattern string, paths ...string)

func (*BuntCache) Delete

func (bc *BuntCache) Delete(key string) error

func (*BuntCache) Get

func (bc *BuntCache) Get(key string) (val string, err error)

func (*BuntCache) GetDB

func (bc *BuntCache) GetDB() *buntdb.DB

func (*BuntCache) GetObject

func (bc *BuntCache) GetObject(key string, val interface{}) (err error)

func (*BuntCache) Iterate

func (bc *BuntCache) Iterate(iterator func(key, val string) bool)

func (*BuntCache) Set

func (bc *BuntCache) Set(key string, obj interface{}) error

func (*BuntCache) SetDefaultConverter

func (bc *BuntCache) SetDefaultConverter(converter Converter)

type Converter

type Converter interface {
	Encode(obj interface{}) (string, error)
	Decode(val string, obj interface{}) error
}

type Dataset

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

func NewDataset

func NewDataset(p string, coder Converter) *Dataset

func (*Dataset) Decode

func (ds *Dataset) Decode(val string, obj interface{}) error

func (*Dataset) Encode

func (ds *Dataset) Encode(obj interface{}) (string, error)

func (*Dataset) Match

func (ds *Dataset) Match(key string) bool

type Portion

type Portion interface {
	Converter
	Match(key string) bool
}

Jump to

Keyboard shortcuts

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