resolver

package
v3.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateResolver

type AggregateResolver []BuildResolverFn

func NewAggregateResolver

func NewAggregateResolver(resolvers ...BuildResolverFn) AggregateResolver

NewAggregateResolver creates an AggregateResolver from a list of BuildResolverFn, appending a final resolver for capturing the case that no build is found by any resolver

func (AggregateResolver) Resolve

func (ar AggregateResolver) Resolve(ctx context.Context) (*build.Build, error)

Resolve is a BuildResolverFn that wraps up a list of resolvers to loop through and try find a build. The first build to be found will be returned. If none are found, it won't return an error to match the expectation of a BuildResolverFn

This is safe to call multiple times, the same result will be returned

func (AggregateResolver) WithResolverWhen

func (ar AggregateResolver) WithResolverWhen(condition bool, resovler BuildResolverFn) AggregateResolver

type BuildResolverFn

type BuildResolverFn func(context.Context) (*build.Build, error)

BuildResolverFn is a function for finding a build. It returns an error if an irrecoverable scenario happens and should halt execution. Otherwise, if the resolver does not find a build, it should return (nil, nil) to indicate this. ie. no error occurred, but no build was found either

func ResolveBuildWithOpts

func ResolveBuildWithOpts(f *factory.Factory, pipelineResolver pipelineResolver.PipelineResolverFn, listOpts ...options.OptionsFn) BuildResolverFn

func ResolveFromPositionalArgument

func ResolveFromPositionalArgument(args []string, index int, pipeline pipelineResolver.PipelineResolverFn, conf *config.Config) BuildResolverFn

func ResolveFromURL

func ResolveFromURL(args []string) BuildResolverFn

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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