Documentation
¶
Index ¶
- Variables
- func HydrateStepContext(ctx context.Context, blobs BlobStore, outputs map[string]StepOutputRef) (json.RawMessage, error)
- func LoadStepOutput(ctx context.Context, blobs BlobStore, ref StepOutputRef) (json.RawMessage, error)
- type BlobRef
- type BlobStore
- type ListFilter
- type Repository
- type RunSnapshot
- type RunStatus
- type StepOutputRef
- type TokenPayload
- type TokenSigner
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("runstate: not found") ErrStaleSnapshot = errors.New("runstate: snapshot version is stale") ErrInvalidStatus = errors.New("runstate: invalid status") ErrInvalidTransition = errors.New("runstate: invalid status transition") ErrTokenSuperseded = errors.New("humangate: token superseded by newer version") )
View Source
var ErrInvalidToken = errors.New("runstate: invalid token")
Functions ¶
func HydrateStepContext ¶ added in v0.1.3
func HydrateStepContext(ctx context.Context, blobs BlobStore, outputs map[string]StepOutputRef) (json.RawMessage, error)
HydrateStepContext loads inline and blob-backed step outputs into a JSON object shaped as {"steps":{"<node_id>":...}} suitable for hybrid run context.
func LoadStepOutput ¶ added in v0.1.3
func LoadStepOutput(ctx context.Context, blobs BlobStore, ref StepOutputRef) (json.RawMessage, error)
LoadStepOutput resolves a step output reference from inline or blob storage.
Types ¶
type BlobRef ¶
type BlobRef struct {
ID string `json:"id"`
Size int64 `json:"size"`
Sha256 string `json:"sha256"`
}
func NewBlobRef ¶
type ListFilter ¶ added in v0.1.1
type ListFilter struct {
// Status, when non-empty, restricts results to snapshots with this status.
Status RunStatus
// ScenarioName, when non-empty, restricts results to a specific scenario.
ScenarioName string
// Limit is the maximum number of results to return. 0 means no limit.
Limit int
}
ListFilter controls which snapshots are returned by Repository.List. Zero values are treated as "no filter" for the corresponding field.
type Repository ¶
type Repository interface {
Save(ctx context.Context, snapshot *RunSnapshot, expectedVersion int64) error
Load(ctx context.Context, runID string) (RunSnapshot, error)
Delete(ctx context.Context, runID string) error
// List returns snapshots that match the filter. Implementations may
// return results in any order. An empty filter matches all snapshots.
List(ctx context.Context, filter ListFilter) ([]RunSnapshot, error)
}
type RunSnapshot ¶
type RunSnapshot struct {
RunID string `json:"run_id"`
Version int64 `json:"version"`
ScenarioName string `json:"scenario_name"`
CurrentNodeID string `json:"current_node_id,omitempty"`
Status RunStatus `json:"status"`
Variables map[string]json.RawMessage `json:"variables,omitempty"`
StepOutputs map[string]StepOutputRef `json:"step_outputs,omitempty"`
PendingGate *core.CheckpointState `json:"pending_gate,omitempty"`
}
func (RunSnapshot) Validate ¶
func (s RunSnapshot) Validate() error
type StepOutputRef ¶
type StepOutputRef struct {
Inline json.RawMessage `json:"inline,omitempty"`
Blob *BlobRef `json:"blob,omitempty"`
}
type TokenPayload ¶
type TokenSigner ¶
type TokenSigner struct {
// contains filtered or unexported fields
}
func NewTokenSigner ¶
func NewTokenSigner(secret []byte) (*TokenSigner, error)
func (*TokenSigner) Sign ¶
func (s *TokenSigner) Sign(payload TokenPayload) (string, error)
func (*TokenSigner) Verify ¶
func (s *TokenSigner) Verify(token string) (TokenPayload, error)
Click to show internal directories.
Click to hide internal directories.