resolver

package
v3.0.0-beta.20240613 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 15 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

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 ResolveBuildForCurrentUser

func ResolveBuildForCurrentUser(branch string, pipelineResolver pipelineResolver.PipelineResolverFn, f *factory.Factory) BuildResolverFn

ResolveBuildFromCurrentBranch Finds the most recent build for the branch in the current working directory

func ResolveBuildFromCurrentBranch

func ResolveBuildFromCurrentBranch(repo *git.Repository, pipelineResolver pipelineResolver.PipelineResolverFn, f *factory.Factory) BuildResolverFn

ResolveBuildFromCurrentBranch Finds the most recent build for the branch in the current working directory

func ResolveFromPositionalArgument

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

func ResolveFromURL

func ResolveFromURL(args []string) BuildResolverFn

Jump to

Keyboard shortcuts

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