state

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type FnExpiryCallback

type FnExpiryCallback func(string)

type State

type State interface {
	// Get retrieve the value associated to the given key.
	// If the key doesn't exists, an error ErrKeyNotFound will be returned
	Get(ctx context.Context, key string) (*types.Function, error)
	// Set a tuple of key/value in the state
	Set(ctx context.Context, fn *types.Function) error
	// SetMultiple set multiple keys in one call
	SetMultiple(ctx context.Context, functions []*types.Function) []error

	SetWithExpiry(ctx context.Context, key string, expiry time.Duration) error
}

State is a generic interface for our controller state

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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