Documentation ¶
Index ¶
- func Create(ctx context.Context, name string) (*cacher, error)
- func CreateInDirectory(ctx context.Context, name string, cacheDir string) (*cacher, error)
- func CreateListener(source chan []byte) *listeners
- func WaitForCurrent(ctx context.Context, v Version) []byte
- type CacheableFunction
- type Cacher
- type Reactive
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateInDirectory ¶
func CreateListener ¶
func CreateListener(source chan []byte) *listeners
Types ¶
type CacheableFunction ¶
type CacheableFunction func(ctx context.Context, stdout io.Writer, stderr io.Writer) (result []byte, err error)
A CacheableFunction is provided with writers for any stdout/stderr they produce, along with a context which may be cancelled.
type Reactive ¶
This type is used when you don't really care about being
notified on changes; it's sufficient to be able to get the current value on demand.
func (Reactive) CancelNotifyOnChange ¶
func (Reactive) NotifyOnChange ¶
func (r Reactive) NotifyOnChange(initial []byte, onChanged context.CancelFunc) int
type Version ¶
type Version interface { Current() []byte // NotifyOnChange registers a context which should receive a // cancelled context if the version changes NotifyOnChange(initial []byte, ctxCancel context.CancelFunc) int // CancelNotifyOnChange deregisters the NotifyOnChange registration. CancelNotifyOnChange(i int) }
func CreateHybrid ¶
func CreateNullVersion ¶
func CreateNullVersion() Version
Click to show internal directories.
Click to hide internal directories.