buildplan

package
v0.0.0-...-277eb20 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const NamespaceInternal = "internal"

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	ArtifactID  strfmt.UUID
	DisplayName string
	MimeType    string
	URL         string
	LogURL      string
	Errors      []string
	Checksum    string
	Status      string

	Ingredients []*Ingredient `json:"-"` // While most artifacts only have a single ingredient, some artifacts such as installers can have multiple.
	// contains filtered or unexported fields
}

Artifact represents a downloadable artifact. This artifact may or may not be installable by the State Tool.

func (*Artifact) Name

func (a *Artifact) Name() string

Name returns the name of the ingredient for this artifact, if it only has exactly one ingredient associated. Otherwise it returns the DisplayName, which is less reliable and consistent.

func (*Artifact) NameAndVersion

func (a *Artifact) NameAndVersion() string

func (*Artifact) RuntimeDependencies

func (a *Artifact) RuntimeDependencies(recursive bool) Artifacts

func (*Artifact) SetDownload

func (a *Artifact) SetDownload(uri string, checksum string)

SetDownload is used to update the URL and checksum of an artifact. This allows us to keep using the same artifact type, while also facilitating dressing up in-progress artifacts with their download info later on

func (*Artifact) Version

func (a *Artifact) Version() string

Version returns the name of the ingredient for this artifact, if it only has exactly one ingredient associated. Otherwise it returns an empty version.

type ArtifactChangeset

type ArtifactChangeset struct {
	Added   []*Artifact
	Removed []*Artifact
	Updated []ArtifactUpdate
}

type ArtifactIDMap

type ArtifactIDMap map[strfmt.UUID]*Artifact

type ArtifactNameMap

type ArtifactNameMap map[string]*Artifact

type ArtifactRelation

type ArtifactRelation struct {
	Artifact *Artifact
	Relation Relation
}

type ArtifactUpdate

type ArtifactUpdate struct {
	From *Artifact
	To   *Artifact
}

func (ArtifactUpdate) VersionsChanged

func (a ArtifactUpdate) VersionsChanged() bool

type Artifacts

type Artifacts []*Artifact

func (Artifacts) Filter

func (a Artifacts) Filter(filters ...FilterArtifact) Artifacts

func (Artifacts) Ingredients

func (a Artifacts) Ingredients() Ingredients

func (Artifacts) RuntimeDependencies

func (as Artifacts) RuntimeDependencies(recursive bool) Artifacts

func (Artifacts) ToIDMap

func (a Artifacts) ToIDMap() ArtifactIDMap

func (Artifacts) ToIDSlice

func (a Artifacts) ToIDSlice() []strfmt.UUID

func (Artifacts) ToNameMap

func (a Artifacts) ToNameMap() ArtifactNameMap

type BuildPlan

type BuildPlan struct {
	// contains filtered or unexported fields
}

func Unmarshal

func Unmarshal(data []byte) (*BuildPlan, error)

func (*BuildPlan) Artifacts

func (b *BuildPlan) Artifacts(filters ...FilterArtifact) Artifacts

func (*BuildPlan) DiffArtifacts

func (b *BuildPlan) DiffArtifacts(oldBp *BuildPlan, requestedOnly bool) ArtifactChangeset

func (*BuildPlan) Engine

func (b *BuildPlan) Engine() types.BuildEngine

func (*BuildPlan) Ingredients

func (b *BuildPlan) Ingredients(filters ...filterIngredient) Ingredients

func (*BuildPlan) IsBuildInProgress

func (b *BuildPlan) IsBuildInProgress() bool

func (*BuildPlan) IsBuildReady

func (b *BuildPlan) IsBuildReady() bool

func (*BuildPlan) Marshal

func (b *BuildPlan) Marshal() ([]byte, error)

func (*BuildPlan) Platforms

func (b *BuildPlan) Platforms() []strfmt.UUID

func (*BuildPlan) RecipeID

func (b *BuildPlan) RecipeID() (strfmt.UUID, error)

RecipeID extracts the recipe ID from the BuildLogIDs. We do this because if the build is in progress we will need to reciepe ID to initialize the build log streamer. This information will only be populated if the build is an alternate build. This is specified in the build planner queries.

func (*BuildPlan) RequestedArtifacts

func (b *BuildPlan) RequestedArtifacts() Artifacts

RequestedArtifacts returns the resolved requirements of the buildplan as artifacts

func (*BuildPlan) RequestedIngredients

func (b *BuildPlan) RequestedIngredients() Ingredients

RequestedIngredients returns the resolved requirements of the buildplan as ingredients

func (*BuildPlan) Requirements

func (b *BuildPlan) Requirements() Requirements

Requirements returns what the project has defined as the top level requirements (ie. the "order"). This is usually the same as the "ingredients" but it can be different if the project has multiple requirements that are satisfied by the same ingredient. eg. rake is satisfied by ruby.

type FilterArtifact

type FilterArtifact func(a *Artifact) bool

func FilterArtifactIDs

func FilterArtifactIDs(ids ...strfmt.UUID) FilterArtifact

func FilterBuildtimeArtifacts

func FilterBuildtimeArtifacts() FilterArtifact

func FilterPlatformArtifacts

func FilterPlatformArtifacts(platformID strfmt.UUID) FilterArtifact

func FilterRuntimeArtifacts

func FilterRuntimeArtifacts() FilterArtifact

func FilterStateArtifacts

func FilterStateArtifacts() FilterArtifact

func FilterSuccessfulArtifacts

func FilterSuccessfulArtifacts() FilterArtifact

type Ingredient

type Ingredient struct {
	*raw.IngredientSource

	IsBuildtimeDependency bool
	IsRuntimeDependency   bool
	Artifacts             []*Artifact
	// contains filtered or unexported fields
}

func (*Ingredient) RuntimeDependencies

func (i *Ingredient) RuntimeDependencies(recursive bool) Ingredients

type IngredientIDMap

type IngredientIDMap map[strfmt.UUID]*Ingredient

type IngredientNameMap

type IngredientNameMap map[string]*Ingredient

type Ingredients

type Ingredients []*Ingredient

func (Ingredients) Filter

func (i Ingredients) Filter(filters ...filterIngredient) Ingredients

func (Ingredients) ToIDMap

func (i Ingredients) ToIDMap() IngredientIDMap

func (Ingredients) ToNameMap

func (i Ingredients) ToNameMap() IngredientNameMap

type Relation

type Relation int
const (
	RuntimeRelation Relation = iota
	BuildtimeRelation
)

type Requirement

type Requirement struct {
	*types.Requirement
	// Requirements are not ingredients, because multiple requirements can be satisfied by the same ingredient,
	// for example `rake` is satisfied by `ruby`.
	Ingredient *Ingredient
}

type Requirements

type Requirements []*Requirement

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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