resolver

package
v3.0.0-beta.testing Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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