Versions in this module Expand all Collapse all v1 v1.0.0 Sep 1, 2025 v0 v0.0.0 Aug 21, 2025 Changes in this version + var ErrDuplicateBinding = errors.New("duplicate binding") + var ErrDuplicateProvidedKeys = errors.New("keys provided by multiple tasks") + var ErrDuplicateTaskNames = errors.New("duplicate task names") + var ErrExposedKeyNotProvided = errors.New("key(s) exposed but not provided by graph") + var ErrGraphCycle = errors.New("found cycle in graph") + var ErrIsAbsent = errors.New("is absent") + var ErrIsPending = errors.New("is pending") + var ErrMissingInputs = errors.New("missing inputs") + var ErrMultipleMaybesPresent = errors.New("multiple present maybes passed to SelectSingleMaybe") + var ErrNoMaybesPresent = errors.New("no present maybes passed to SelectSingleMaybe") + var ErrTooManyTasks = wrapStackErrorf("too many tasks in graph (limit %d)", taskLimit) + var ErrWrongType = errors.New("wrong type") + func ErrorsMaybe(maybes ...MaybeStatus) error + func MissingMaybe(maybes map[string]MaybeStatus) []string + func Must[T any](val T, err error) T + func RegisterMetrics(registry prometheus.Registerer) + func SelectSingleMaybe[T any](maybes ...Maybe[T]) (T, error) + type BindStatus int + const Absent + const Pending + const Present + func (bs BindStatus) String() string + type Binder interface + Get func(ID) Binding + GetAll func() []Binding + Has func(...ID) bool + Store func(...Binding) error + func NewBinder() Binder + func NewOverlayBinder(base, overlay Binder) Binder + func TestOnlyNewGraphTaskBinder(internal, external Binder, exposeKeys set.Set[ID]) Binder + type Binding interface + Error func() error + ID func() ID + Status func() BindStatus + Value func() any + type Condition interface + Deps func() []ID + Evaluate func(ctx context.Context, b Binder) (bool, error) + type ConditionAnd []ReadOnlyKey[bool] + func (ca ConditionAnd) Deps() []ID + func (ca ConditionAnd) Evaluate(_ context.Context, b Binder) (bool, error) + type ConditionOr []ReadOnlyKey[bool] + func (co ConditionOr) Deps() []ID + func (co ConditionOr) Evaluate(_ context.Context, b Binder) (bool, error) + type Conditional struct + Condition Condition + DefaultBindings []Binding + NamePrefix string + Wrapped TaskSet + func (c Conditional) Locate() Conditional + func (c Conditional) Tasks() []Task + type Graph interface + AsTask func(exposeKeys ...ID) (Task, error) + Check func(inputs ...Binding) error + Graphviz func(includeInputs bool) string + Run func(ctx context.Context, inputs ...Binding) (Binder, error) + func New(name string, opts ...GraphOption) (Graph, error) + type GraphOption func(opts *GraphOptions) error + func WithTasks(tasks ...TaskSet) GraphOption + func WithTracer(tracer trace.Tracer) GraphOption + type GraphOptions struct + type ID struct + func (i ID) String() string + type Key interface + Bind func(val T) Binding + BindAbsent func() Binding + BindError func(err error) Binding + func NewKey[T any](id string) Key[T] + func NewNamespacedKey[T any](namespace, id string) Key[T] + type Maybe struct + func MaybeErr[T any](err error) Maybe[T] + func MaybeOf[T any](val T) Maybe[T] + func WrapMaybe[T any](val T, err error) Maybe[T] + func (m Maybe[T]) Error() error + func (m Maybe[T]) Get() (T, error) + func (m Maybe[T]) Present() bool + type MaybeStatus interface + Error func() error + Present func() bool + type ReadOnlyKey interface + Get func(Binder) (T, error) + ID func() ID + Location func() string + func Mapped[In, Out any](key ReadOnlyKey[In], fn func(In) Out) ReadOnlyKey[Out] + func Not(key ReadOnlyKey[bool]) ReadOnlyKey[bool] + func Optional[T any](base ReadOnlyKey[T]) ReadOnlyKey[Maybe[T]] + func Presence[T any](key ReadOnlyKey[T]) ReadOnlyKey[bool] + type Reflect struct + Depends []any + Fn any + Name string + ResultKey Key[T] + func (r Reflect[T]) Build() (Task, error) + func (r Reflect[T]) Locate() Reflect[T] + func (r Reflect[T]) Tasks() []Task + type ReflectMulti struct + Depends []any + Fn any + Name string + Provides []ID + func (r ReflectMulti) Build() (Task, error) + func (r ReflectMulti) Locate() ReflectMulti + func (r ReflectMulti) Tasks() []Task + type Task interface + Depends func() []ID + Execute func(context.Context, Binder) ([]Binding, error) + Location func() string + Name func() string + Provides func() []ID + func AllBound(name string, result Key[bool], deps ...ID) Task + func NewTask(name string, fn func(context.Context, Binder) ([]Binding, error), ...) Task + func NoOutputTask(name string, fn func(ctx context.Context, b Binder) error, depends ...ID) Task + func SimpleTask1[A1, Res any](name string, resKey Key[Res], ...) Task + func SimpleTask2[A1, A2, Res any](name string, resKey Key[Res], ...) Task + func SimpleTask[T any](name string, key Key[T], fn func(ctx context.Context, b Binder) (T, error), ...) Task + type TaskSet interface + Tasks func() []Task + func NewTaskSet(els ...TaskSet) TaskSet