cache

package
v0.0.0-...-bf4a537 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2018 License: BSD-3-Clause Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CombinedStorage

type CombinedStorage struct {
	FstLevel Storage
	SndLevel Storage
}

func (*CombinedStorage) Delete

func (s *CombinedStorage) Delete(key interface{})

func (*CombinedStorage) Fetch

func (s *CombinedStorage) Fetch(key interface{}) (value interface{})

func (*CombinedStorage) Flush

func (s *CombinedStorage) Flush()

func (*CombinedStorage) Store

func (s *CombinedStorage) Store(key, value interface{})

type Flusher

type Flusher interface {
	Flush()
}

type IsFresher

type IsFresher interface {
	IsFresh() bool
}

type LoaderFunc

type LoaderFunc func(interface{}) (interface{}, error)

type Manager

type Manager struct {
	DB   *bolt.DB
	Size int
	L    logging.Logger
	// contains filtered or unexported fields
}

func (*Manager) Flush

func (m *Manager) Flush()

func (*Manager) NewMemo

func (m *Manager) NewMemo(name string, sample interface{}, l LoaderFunc) Memo

func (*Manager) NewStorage

func (m *Manager) NewStorage(name string, sample interface{}) Storage

type Memo

type Memo interface {
	Get(key interface{}) <-chan interface{}
}

type SingleFlight

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

func NewSingleFlight

func NewSingleFlight() *SingleFlight

func (*SingleFlight) Do

func (f *SingleFlight) Do(key interface{}, fn func(interface{}) (interface{}, bool)) <-chan interface{}

type Storage

type Storage interface {
	Store(key, value interface{})
	Fetch(key interface{}) interface{}
	Delete(key interface{})
}

func NewBoltDBStorage

func NewBoltDBStorage(db *bolt.DB, bucket string, sample interface{}, l logging.Logger) Storage

func NewMapStorage

func NewMapStorage() Storage

Jump to

Keyboard shortcuts

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