store

package
v0.0.0-...-d92b2c6 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(min, max, worst int) error

Types

type Entry

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

func NewEntry

func NewEntry(key Key, size int) Entry

func (Entry) Access

func (e Entry) Access() Entry

type EntryList

type EntryList []Entry

func (EntryList) Len

func (l EntryList) Len() int

func (EntryList) Less

func (l EntryList) Less(i, j int) bool

func (EntryList) Push

func (l EntryList) Push(entry Entry) (next EntryList, delta int)

func (EntryList) Swap

func (l EntryList) Swap(i, j int)

type EntryMap

type EntryMap map[Key][]byte

func (EntryMap) Clone

func (m EntryMap) Clone() (next EntryMap)

type Key

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

func DecodeKey

func DecodeKey(text string) (key Key, err error)

func (Key) Next

func (k Key) Next(extension string) Key

func (Key) String

func (k Key) String() string

type Metrics

type Metrics struct {
	Min     int
	Max     int
	Total   int
	Average float64
}

type Store

type Store struct {
	// contains filtered or unexported fields
}
var Default *Store

func (*Store) Access

func (s *Store) Access(key Key)

func (*Store) Get

func (s *Store) Get(key Key) (data []byte, ok bool)

func (*Store) Put

func (s *Store) Put(data []byte, extension string) (key Key, err error)

func (*Store) Stats

func (s *Store) Stats() (stats Metrics)

Jump to

Keyboard shortcuts

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