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 ¶
StatefulInput api.Input that need to be lossless when restart or redeploy must impl this interface. TODO Supports states with different version are incompatible
Click to show internal directories.
Click to hide internal directories.