Documentation ¶
Index ¶
- func PassthruPicker(p []pipeline.Pipeline) *pipeline.Pipeline
- func PickOne(pipelines []pipeline.Pipeline) *pipeline.Pipeline
- type AggregateResolver
- type PipelinePicker
- type PipelineResolverFn
- func ResolveFromConfig(conf *config.Config, picker PipelinePicker) PipelineResolverFn
- func ResolveFromFlag(flag string, conf *config.Config) PipelineResolverFn
- func ResolveFromPositionalArgument(args []string, index int, conf *config.Config) PipelineResolverFn
- func ResolveFromRepository(f *factory.Factory, picker PipelinePicker) PipelineResolverFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AggregateResolver ¶
type AggregateResolver []PipelineResolverFn
func NewAggregateResolver ¶
func NewAggregateResolver(resolvers ...PipelineResolverFn) AggregateResolver
NewAggregateResolver creates an AggregregateResolver from a list of PipelineResolverFn, appending a final resolver for capturing the case that no resolvers find a pipeline
func (AggregateResolver) Resolve ¶
Resolve is a PipelineResolverFn that wraps up a list of resolvers to loop through to try find a pipeline. The first pipeline that is found will be returned, if none are found if won't return an error to match the expectation of a PipelineResolveFn
This is safe to call multiple times. The same result will be returned.
type PipelinePicker ¶
PipelinePicker is a function used to pick a pipeline from a list.
It is indended to be used from pipeline resolvers that resolve multiple pipelines.
func CachedPicker ¶
func CachedPicker(conf *config.Config, picker PipelinePicker) PipelinePicker
CachedPicker returns a PipelinePicker that saves the given pipelines to local config as well as running the provider picker.
type PipelineResolverFn ¶
PipelineResolverFn is a function for the purpose of finding a pipeline. It returns an error if an irrecoverable scenario happens and should halt execution. Otherwise if the resolver does not find a pipeline, it should return (nil, nil) to indicate this. ie. no error occurred, but no pipeline was found either.
func ResolveFromConfig ¶
func ResolveFromConfig(conf *config.Config, picker PipelinePicker) PipelineResolverFn
func ResolveFromFlag ¶
func ResolveFromFlag(flag string, conf *config.Config) PipelineResolverFn
func ResolveFromPositionalArgument ¶
func ResolveFromPositionalArgument(args []string, index int, conf *config.Config) PipelineResolverFn
func ResolveFromRepository ¶
func ResolveFromRepository(f *factory.Factory, picker PipelinePicker) PipelineResolverFn
ResolveFromRepository finds pipelines based on the current repository.
It queries the API for all pipelines in the organization that match the repository's URL. It delegates picking one from the list of matches to the `picker`.