Documentation ¶
Index ¶
- type Repository
- func (r *Repository) ClaimNode(_ context.Context, runID, name string, claim *adagio.Claim) (*adagio.Node, bool, error)
- func (r *Repository) FinishNode(_ context.Context, runID, name string, result *adagio.Node_Result, ...) error
- func (r *Repository) InspectRun(_ context.Context, id string) (*adagio.Run, error)
- func (r *Repository) ListAgents(_ context.Context) (agents []*adagio.Agent, err error)
- func (r *Repository) ListRuns(_ context.Context, req controlplane.ListRequest) (runs []*adagio.Run, err error)
- func (r *Repository) StartRun(_ context.Context, spec *adagio.GraphSpec) (run *adagio.Run, err error)
- func (r *Repository) Stats(context.Context) (*adagio.Stats, error)
- func (r *Repository) Subscribe(_ context.Context, agent *adagio.Agent, events chan<- *adagio.Event, ...) error
- func (r *Repository) UnsubscribeAll(_ context.Context, agent *adagio.Agent, events chan<- *adagio.Event) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is an in-memory implementation of the adagio Repository interfaces It adheres to the repository test harness
func (*Repository) ClaimNode ¶
func (r *Repository) ClaimNode(_ context.Context, runID, name string, claim *adagio.Claim) (*adagio.Node, bool, error)
ClaimNode attempts to make a claim for a node
func (*Repository) FinishNode ¶
func (r *Repository) FinishNode(_ context.Context, runID, name string, result *adagio.Node_Result, claim *adagio.Claim) error
FinishNode reports the result of a node run and readies any eligible outgoing nodes
func (*Repository) InspectRun ¶
InspectRun returns a run for the provided run ID
func (*Repository) ListAgents ¶
ListAgents returns a set of subscribed agents
func (*Repository) ListRuns ¶
func (r *Repository) ListRuns(_ context.Context, req controlplane.ListRequest) (runs []*adagio.Run, err error)
ListRuns returns a list of runs in descending order based on a set of provided predicates
func (*Repository) StartRun ¶
func (r *Repository) StartRun(_ context.Context, spec *adagio.GraphSpec) (run *adagio.Run, err error)
StartRun instantiates a run from a provided graph specification
func (*Repository) Subscribe ¶
func (r *Repository) Subscribe(_ context.Context, agent *adagio.Agent, events chan<- *adagio.Event, types ...adagio.Event_Type) error
Subscribe registers the provided channel to listen for the defined event types
func (*Repository) UnsubscribeAll ¶
func (r *Repository) UnsubscribeAll(_ context.Context, agent *adagio.Agent, events chan<- *adagio.Event) error
UnsubscribeAll unsubscribes the channel for all event types