memo

package
v0.0.0-...-5948a14 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2020 License: CC0-1.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Func

type Func func(key string, done <-chan struct{}) (interface{}, error)

Func is a memoization function

type Memo

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

Memo represents a memoized cache

func New

func New(f Func) *Memo

New returns a memoiztaion of f. Clients must subsequently call Close.

func (*Memo) Close

func (memo *Memo) Close()

Close the channel for requests

func (*Memo) Get

func (memo *Memo) Get(key string, done <-chan struct{}) (interface{}, error)

Get invokes the function to be memoized

Jump to

Keyboard shortcuts

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