integ

package
v0.0.0-...-2ff6a3e Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(key string, builder func() interface{}) (value interface{}, ok bool)
	GetOrBuild(key string, builder func() (interface{}, error)) (value interface{}, err error)
	Put(key string, value interface{})
	Clear()
}

type ObjectCache

type ObjectCache interface {
	Get() (ret interface{}, err error)
}

type SimpleCache

type SimpleCache struct {
	MaxSize int
	// contains filtered or unexported fields
}

func NewCache

func NewCache() *SimpleCache

func (SimpleCache) Clear

func (o SimpleCache) Clear()

func (SimpleCache) Get

func (o SimpleCache) Get(key string, builder func() interface{}) (value interface{}, ok bool)

func (SimpleCache) GetOrBuild

func (o SimpleCache) GetOrBuild(key string, builder func() (interface{}, error)) (value interface{}, err error)

func (SimpleCache) Put

func (o SimpleCache) Put(key string, value interface{})

type TimeoutObjectCache

type TimeoutObjectCache struct {
	Timeout time.Duration
	Builder func() (interface{}, error)
	// contains filtered or unexported fields
}

func NewObjectCache

func NewObjectCache(builder func() (interface{}, error)) *TimeoutObjectCache

func (*TimeoutObjectCache) Get

func (o *TimeoutObjectCache) Get() (ret interface{}, err error)

Jump to

Keyboard shortcuts

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