dam

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2017 License: CC0-1.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type Dam

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

func New

func New(duration time.Duration) *Dam

func (*Dam) Load

func (d *Dam) Load(key Marshallable) (interface{}, error)

func (*Dam) LoadOrStore

func (d *Dam) LoadOrStore(key Marshallable, fetch FetchFunc) (interface{}, error)

func (*Dam) Purge

func (d *Dam) Purge()

func (*Dam) Stop

func (d *Dam) Stop()

func (*Dam) Store

func (d *Dam) Store(key Marshallable, value interface{}) error

type FetchFunc

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

type Marshallable

type Marshallable interface {
	Marshal() ([]byte, error)
}

Jump to

Keyboard shortcuts

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