transfer

package
v0.0.0-...-5c7ffcf Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.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 MemoryStateStore

type MemoryStateStore struct {
	State map[string]interface{}
}

func NewMemoryStateStore

func NewMemoryStateStore() *MemoryStateStore

func (*MemoryStateStore) Get

func (m *MemoryStateStore) Get(key string) (interface{}, error)

func (*MemoryStateStore) Put

func (m *MemoryStateStore) Put(key string, state interface{})

func (*MemoryStateStore) Sub

func (m *MemoryStateStore) Sub(prefix string) StateStore

type StateStore

type StateStore interface {
	// Get returns state associated by key
	Get(key string) (interface{}, error)
	// Put associates state with a key
	Put(key string, state interface{})
	// Sub returns a sub StateStore with key prefixed with the given parameter
	Sub(prefix string) StateStore
}

StateStore stores states for transformation. States must use simple data structures, and expose field names, to ensure they can be successfully serialized and deserialized by gob.

type StatefulComponent

type StatefulComponent interface {
	StopAndSaveState(StateStore) error
	LoadState(StateStore) error
}

type StatefulInput

type StatefulInput interface {
	SaveState() (interface{}, error)
	LoadState(interface{}) error
}

StatefulInput api.Input that need to be lossless when restart or redeploy must impl this interface. TODO Supports states with different version are incompatible

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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