memo

package
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int

type Exchanger

type Exchanger func(key Key, new, eld Value, release bool)

should not do long time run

type KeepLiveOption

type KeepLiveOption struct {
	Duration *time.Duration
}

func (KeepLiveOption) SetDuration

func (opt KeepLiveOption) SetDuration(duration time.Duration) KeepLiveOption

type Key

type Key interface{}

type SetOption

type SetOption struct {
	KeepLiveDuration *time.Duration
}

func (SetOption) SetKeepLive

func (opt SetOption) SetKeepLive(duration time.Duration) SetOption

type Table

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

func NewTable

func NewTable(maxEntry int, keepLiveDuration time.Duration, exchanger Exchanger) *Table

func (*Table) Clear

func (tb *Table) Clear()

func (*Table) Delete

func (tb *Table) Delete(key Key) bool

func (*Table) Fetch

func (tb *Table) Fetch(key Key, def Value) (value Value, loaded bool)

func (*Table) Get

func (tb *Table) Get(key interface{}) (interface{}, bool)

func (*Table) KeepLive

func (tb *Table) KeepLive(key interface{}, option ...KeepLiveOption) bool

func (*Table) Keys

func (tb *Table) Keys() []Key

func (*Table) Set

func (tb *Table) Set(key, value Value, option ...SetOption)

type Value

type Value interface{}

Jump to

Keyboard shortcuts

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