Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunStateStoreContract ¶ added in v0.6.0
func RunStateStoreContract(t *testing.T, store StateStore)
RunStateStoreContract runs a suite of tests to verify that a StateStore implementation adheres to the defined interface contract.
Types ¶
type ActionDispatcher ¶
type ActionDispatcher interface {
Dispatch(req domain.ActionRequest) (domain.ActionResponse, error)
}
ActionDispatcher defines how side-effects are executed. The engine emits requests, and the host implements this interface to handle them.
type GraphLoader ¶
type GraphLoader interface {
// GetNode retrieves the raw definition of a node by ID.
// It returns the raw bytes (which the compiler will parse) or an error.
GetNode(id string) ([]byte, error)
// ListNodes returns a simplified list of all node IDs available in the graph.
// This is used for introspection and visualization tools (e.g. 'trellis graph').
ListNodes() ([]string, error)
}
GraphLoader defines how the engine retrieves node definitions. This allows the storage layer (Loam, FS, Memory) to be decoupled.
type StateStore ¶ added in v0.6.0
type StateStore interface {
// Save persists the state for a given session ID.
Save(ctx context.Context, sessionID string, state *domain.State) error
// Load retrieves the state for a given session ID.
// Returns domain.ErrSessionNotFound if the session does not exist.
Load(ctx context.Context, sessionID string) (*domain.State, error)
// Delete removes the state for a given session ID.
Delete(ctx context.Context, sessionID string) error
// List returns all active session IDs.
List(ctx context.Context) ([]string, error)
}
StateStore defines the interface for persisting execution state. This allows for durable execution, enabling "Stop & Resume" workflows.
type Watchable ¶ added in v0.3.2
type Watchable interface {
// Watch returns a channel that is signaled when the underlying graph changes.
// It returns a string (the event type, e.g. "reload") or an error.
Watch(ctx context.Context) (<-chan string, error)
}
Watchable defines an interface for loaders that can notify about backend changes. This is typically used for hot-reload or dev-mode functionality.