memory

package
v0.0.0-...-a93a756 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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 New

func New() *Repository

New constructs and configures a new in memory repository

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

func (r *Repository) InspectRun(_ context.Context, id string) (*adagio.Run, error)

InspectRun returns a run for the provided run ID

func (*Repository) ListAgents

func (r *Repository) ListAgents(_ context.Context) (agents []*adagio.Agent, err error)

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) Stats

func (r *Repository) Stats(context.Context) (*adagio.Stats, error)

Stats returns counts of runs and nodes in their respective states

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

Jump to

Keyboard shortcuts

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