store

package
v0.0.0-...-04026ef Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTaskContractAlreadyOwned = errors.New("task_contract_already_owned")
	ErrGraphContractMismatch    = errors.New("graph_contract_mismatch")
	ErrGraphNotFound            = errors.New("graph_not_found")
	ErrTaskContractNotFound     = errors.New("task_contract_not_found")
	ErrRunNotFound              = errors.New("run_not_found")
	ErrAttemptNotFound          = errors.New("attempt_not_found")
	ErrArtifactNotFound         = errors.New("artifact_not_found")
	ErrExecutionBindingMissing  = errors.New("execution_binding_missing")
)

Functions

This section is empty.

Types

type NodeSpec

type NodeSpec struct {
	ID    string
	Task  string
	Input model.NodeInput
}

type PublishPackageParams

type PublishPackageParams struct {
	Package   string
	Contracts []PublishTaskContractParams
	Graphs    []RegisterGraphParams
}

type PublishPackageResult

type PublishPackageResult struct {
	Contracts map[string]string
	Graphs    map[string]string
}

type PublishTaskContractParams

type PublishTaskContractParams struct {
	Task         string
	OwnerPackage string
	InputSchema  json.RawMessage
	OutputSchema json.RawMessage
}

type RegisterGraphParams

type RegisterGraphParams struct {
	Name  string
	Nodes []NodeSpec
}

type Store

type Store interface {
	PublishTaskContract(context.Context, PublishTaskContractParams) (model.TaskContract, error)
	LoadTaskContract(context.Context, string, string) (model.TaskContract, error)
	LoadTaskContractHead(context.Context, string) (model.TaskContractHead, error)
	ListTaskContractHeadsByOwner(context.Context, string) ([]model.TaskContractHead, error)
	RegisterGraph(context.Context, RegisterGraphParams) (model.GraphDefinition, error)
	PublishPackage(context.Context, PublishPackageParams) (PublishPackageResult, error)
	LoadGraph(context.Context, string) (model.GraphDefinition, error)
	LoadGraphHead(context.Context, string) (string, error)
	CreateRunForGraph(context.Context, string, json.RawMessage) (model.RunRecord, error)
	LoadRunRecord(context.Context, string) (model.RunRecord, error)
	ListActiveRunIDs(context.Context) ([]string, error)
	ClaimAttempt(context.Context, string, string, time.Time, time.Time) (model.Attempt, bool, error)
	LoadAttempt(context.Context, string) (model.Attempt, error)
	RenewAttempt(context.Context, string, time.Time) (bool, error)
	ListAttempts(context.Context, string, *string) ([]model.Attempt, error)
	RetryNode(context.Context, string, string) (bool, error)
	CommitSuccess(context.Context, string, string, string, time.Time, json.RawMessage) (bool, error)
	CommitFailure(context.Context, string, string, string, time.Time, string) (bool, error)
	CommitRetry(context.Context, string, string, string, time.Time, string, int, time.Time) (bool, error)
	SaveExecutionBinding(context.Context, model.ExecutionBinding) (model.ExecutionBinding, error)
	LoadExecutionBinding(context.Context, string, string) (model.ExecutionBinding, error)
	DeleteExecutionBinding(context.Context, string, string) (bool, error)
	ListArtifacts(context.Context, string) ([]model.ArtifactRecord, error)
	AcknowledgeArtifactReleased(context.Context, string, time.Time) (model.ArtifactRecord, error)
	Close() error
}

type StoreProvider

type StoreProvider interface {
	DefaultStore(context.Context) (Store, error)
	ForTenant(context.Context, TenantID) (Store, error)
	Close() error
}

StoreProvider resolves one tenant-scoped Store for each request. Providers must reject an empty tenant rather than falling back to another tenant.

type TenantID

type TenantID string

TenantID identifies an isolated tenant namespace. It is intentionally a distinct type so callers cannot accidentally pass arbitrary identifiers.

const DefaultTenant TenantID = "default"

func (TenantID) Valid

func (id TenantID) Valid() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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