Documentation ¶
Index ¶
- func Annotation(k, v string) containers.Option[Metadata]
- func Label(k, v string) containers.Option[Metadata]
- func WithUI(ui fs.FS) containers.Option[System]
- type Config
- type Metadata
- type Phase
- type Pipeline
- type Pipelines
- type Resource
- type ResourcePipeline
- func (p *ResourcePipeline[R]) Add(r core.ResourcePhase[R], opts ...containers.Option[core.AddPhaseOptions[R]]) error
- func (p *ResourcePipeline[R]) Dependencies() map[Phase]Phase
- func (p *ResourcePipeline[R]) Metadata() Metadata
- func (p *ResourcePipeline[R]) New() R
- func (p *ResourcePipeline[R]) PhaseByName(name string) (Phase, error)
- func (p *ResourcePipeline[R]) Phases(opts ...containers.Option[core.PhaseOptions]) iter.Seq[Phase]
- func (p *ResourcePipeline[R]) PromotedFrom(c core.ResourcePhase[R]) (core.ResourcePhase[R], bool)
- type Server
- type System
- func (s *System) AddPipeline(fn func(context.Context, *Config) (core.Pipeline, error)) *System
- func (s *System) AddTrigger(trigger Trigger) *System
- func (s *System) GetPipeline(name string) (core.Pipeline, error)
- func (s *System) Pipelines() iter.Seq2[string, core.Pipeline]
- func (s *System) Run() error
- type Trigger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Annotation ¶
func Annotation(k, v string) containers.Option[Metadata]
Annotation returns a functional option for Metadata which sets a single annotation k/v pair on the provided Metadata
func Label ¶
func Label(k, v string) containers.Option[Metadata]
Label returns a functional option for Metadata which sets a single label k/v pair on the provided Metadata
func WithUI ¶
func WithUI(ui fs.FS) containers.Option[System]
WithUI configures the provided fs.FS implementation to be served as the filesystem mounted on the root path in the API
glu.NewSystem(ctx, glu.Name("mysystem"), glu.WithUI(ui.FS())) see: github.com/get-glu/glu/tree/main/ui sub-module for the pre-built default UI.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is a utility for extracting configured sources by their name derived from glu's conventional configuration format.
func (*Config) GetCredential ¶
func (c *Config) GetCredential(name string) (*credentials.Credential, error)
GetCredential delegates to an underlying credential source built using the same underlying credential configuration.
func (*Config) GitRepository ¶
func (c *Config) GitRepository(ctx context.Context, name string) (_ *git.Repository, proposer srcgit.Proposer, err error)
GitRepository constructs and configures an instance of a *git.Repository using the name to lookup the relevant configuration. It caches built instances and returns the same instance for subsequent calls with the same name.
func (*Config) OCIRepository ¶
func (c *Config) OCIRepository(name string) (_ *oci.Repository, err error)
OCIRepository constructs and configures an instance of a *oci.Repository using the name to lookup the relevant configuration. It caches built instances and returns the same instance for subsequent calls with the same name.
type ResourcePipeline ¶
type ResourcePipeline[R Resource] struct { // contains filtered or unexported fields }
ResourcePipeline is a collection of phases for a given resource type R. It implements the core.Phase interface and is scoped to a single Resource implementation.
func NewPipeline ¶
func NewPipeline[R Resource](meta Metadata, newFn func() R) *ResourcePipeline[R]
NewPipeline constructs and configures a new instance of *ResourcePipeline[R]
func (*ResourcePipeline[R]) Add ¶
func (p *ResourcePipeline[R]) Add(r core.ResourcePhase[R], opts ...containers.Option[core.AddPhaseOptions[R]]) error
Add will add the provided resource phase to the pipeline along with configuring any dependent promotion source phases if configured to do so.
func (*ResourcePipeline[R]) Dependencies ¶
func (p *ResourcePipeline[R]) Dependencies() map[Phase]Phase
Dependencies returns a map of Phase to Phase. This map contains mappings of Phases to their dependent promotion source Phase (if configured).
func (*ResourcePipeline[R]) Metadata ¶
func (p *ResourcePipeline[R]) Metadata() Metadata
Metadata returns the metadata assocated with the Pipelines (name and labels).
func (*ResourcePipeline[R]) New ¶
func (p *ResourcePipeline[R]) New() R
New calls the functions underlying resource constructor function to get a new default instance of the resource.
func (*ResourcePipeline[R]) PhaseByName ¶
func (p *ResourcePipeline[R]) PhaseByName(name string) (Phase, error)
PhaseByName returns the Phase (if it exists) with a matching name.
func (*ResourcePipeline[R]) Phases ¶
func (p *ResourcePipeline[R]) Phases(opts ...containers.Option[core.PhaseOptions]) iter.Seq[Phase]
Phases lists all phases in the pipeline with optional predicates.
func (*ResourcePipeline[R]) PromotedFrom ¶
func (p *ResourcePipeline[R]) PromotedFrom(c core.ResourcePhase[R]) (core.ResourcePhase[R], bool)
PromotedFrom returns the phase which c is configured to promote from (get dependent phase).
type System ¶
type System struct {
// contains filtered or unexported fields
}
System is the primary entrypoint for build a set of Glu pipelines. It supports functions for adding new pipelines, registering triggers running the API server and handly command-line inputs.
func (*System) AddPipeline ¶
AddPipeline invokes a pipeline builder function provided by the caller. The function is provided with the systems configuration and (if successful) the system registers the resulting pipeline.
func (*System) AddTrigger ¶
AddTrigger registers a Trigger to run when the system is invoked in server mode.
func (*System) GetPipeline ¶
GetPipeline returns a pipeline by name.
func (*System) Pipelines ¶
Pipelines returns an iterator across all name and pipeline pairs previously registered on the system.