platform

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 6 Imported by: 12

Documentation

Index

Constants

View Source
const (
	BuildMetadataLabel   = "io.buildpacks.build.metadata"
	LayerMetadataLabel   = "io.buildpacks.lifecycle.metadata"
	ProjectMetadataLabel = "io.buildpacks.project.metadata"
	StackIDLabel         = "io.buildpacks.stack.id"
	MixinsLabel          = "io.buildpacks.stack.mixins"
)
View Source
const CodeFailed = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyzedMetadata

type AnalyzedMetadata struct {
	PreviousImage *ImageIdentifier `toml:"image"`
	Metadata      LayersMetadata   `toml:"metadata"`
	RunImage      *ImageIdentifier `toml:"run-image,omitempty"`
}

type BuildMetadata

type BuildMetadata struct {
	BOM                         []buildpack.BOMEntry       `toml:"bom" json:"bom"`
	Buildpacks                  []buildpack.GroupBuildpack `toml:"buildpacks" json:"buildpacks"`
	Labels                      []buildpack.Label          `toml:"labels" json:"-"`
	Launcher                    LauncherMetadata           `toml:"-" json:"launcher"`
	Processes                   []launch.Process           `toml:"processes" json:"processes"`
	Slices                      []layers.Slice             `toml:"slices" json:"-"`
	BuildpackDefaultProcessType string                     `toml:"buildpack-default-process-type,omitempty" json:"buildpack-default-process-type,omitempty"`
}

func (BuildMetadata) ToLaunchMD

func (md BuildMetadata) ToLaunchMD() launch.Metadata

type BuildPlan

type BuildPlan struct {
	Entries []BuildPlanEntry `toml:"entries"`
}

func (BuildPlan) Filter

func (p BuildPlan) Filter(metRequires []string) BuildPlan

TODO: ensure at least one claimed entry of each name is provided by the BP

func (BuildPlan) Find

func (p BuildPlan) Find(bpID string) buildpack.Plan

type BuildPlanEntry

type BuildPlanEntry struct {
	Providers []buildpack.GroupBuildpack `toml:"providers"`
	Requires  []buildpack.Require        `toml:"requires"`
}

func (BuildPlanEntry) NoOpt

func (be BuildPlanEntry) NoOpt() BuildPlanEntry

type BuildReport

type BuildReport struct {
	BOM []buildpack.BOMEntry `toml:"bom"`
}

type CacheMetadata

type CacheMetadata struct {
	BOM        LayerMetadata              `json:"sbom"`
	Buildpacks []buildpack.LayersMetadata `json:"buildpacks"`
}

func (*CacheMetadata) MetadataForBuildpack

func (cm *CacheMetadata) MetadataForBuildpack(id string) buildpack.LayersMetadata

type DefaultExiter added in v0.13.2

type DefaultExiter struct{}

func (*DefaultExiter) CodeFor added in v0.13.2

func (e *DefaultExiter) CodeFor(errType LifecycleExitError) int

type Exiter added in v0.13.2

type Exiter interface {
	CodeFor(errType LifecycleExitError) int
}

type ExportReport

type ExportReport struct {
	Build BuildReport `toml:"build,omitempty"`
	Image ImageReport `toml:"image"`
}

type GitMetadata

type GitMetadata struct {
	Repository string `json:"repository"`
	Commit     string `json:"commit"`
}

type ImageIdentifier

type ImageIdentifier struct {
	Reference string `toml:"reference"`
}

FIXME: fix key names to be accurate in the daemon case

type ImageReport

type ImageReport struct {
	Tags         []string `toml:"tags"`
	ImageID      string   `toml:"image-id,omitempty"`
	Digest       string   `toml:"digest,omitempty"`
	ManifestSize int64    `toml:"manifest-size,omitzero"`
}

type LauncherMetadata

type LauncherMetadata struct {
	Version string         `json:"version"`
	Source  SourceMetadata `json:"source"`
}

type LayerMetadata

type LayerMetadata struct {
	SHA string `json:"sha" toml:"sha"`
}

type LayersMetadata

type LayersMetadata struct {
	App          []LayerMetadata            `json:"app" toml:"app"`
	BOM          *LayerMetadata             `json:"sbom,omitempty" toml:"sbom,omitempty"`
	Buildpacks   []buildpack.LayersMetadata `json:"buildpacks" toml:"buildpacks"`
	Config       LayerMetadata              `json:"config" toml:"config"`
	Launcher     LayerMetadata              `json:"launcher" toml:"launcher"`
	ProcessTypes LayerMetadata              `json:"process-types" toml:"process-types"`
	RunImage     RunImageMetadata           `json:"runImage" toml:"run-image"`
	Stack        StackMetadata              `json:"stack" toml:"stack"`
}

NOTE: This struct MUST be kept in sync with `LayersMetadataCompat`

func (*LayersMetadata) MetadataForBuildpack

func (m *LayersMetadata) MetadataForBuildpack(id string) buildpack.LayersMetadata

type LayersMetadataCompat

type LayersMetadataCompat struct {
	App          interface{}                `json:"app" toml:"app"`
	BOM          *LayerMetadata             `json:"sbom,omitempty" toml:"sbom,omitempty"`
	Buildpacks   []buildpack.LayersMetadata `json:"buildpacks" toml:"buildpacks"`
	Config       LayerMetadata              `json:"config" toml:"config"`
	Launcher     LayerMetadata              `json:"launcher" toml:"launcher"`
	ProcessTypes LayerMetadata              `json:"process-types" toml:"process-types"`
	RunImage     RunImageMetadata           `json:"runImage" toml:"run-image"`
	Stack        StackMetadata              `json:"stack" toml:"stack"`
}

NOTE: This struct MUST be kept in sync with `LayersMetadata`. It exists for situations where the `App` field type cannot be guaranteed, yet the original struct data must be maintained.

type LegacyExiter added in v0.13.2

type LegacyExiter struct{}

func (*LegacyExiter) CodeFor added in v0.13.2

func (e *LegacyExiter) CodeFor(errType LifecycleExitError) int

type LifecycleExitError added in v0.13.2

type LifecycleExitError int
const (
	FailedDetect           LifecycleExitError = iota
	FailedDetectWithErrors                    // no buildpacks detected
	DetectError                               // no buildpacks detected and at least one errored
	AnalyzeError                              // generic analyze error
	RestoreError                              // generic restore error
	FailedBuildWithErrors                     // buildpack error during /bin/build
	BuildError                                // generic build error
	ExportError                               // generic export error
	RebaseError                               // generic rebase error
	LaunchError                               // generic launch error
)

type Platform

type Platform struct {
	Exiter
	// contains filtered or unexported fields
}

func NewPlatform

func NewPlatform(apiStr string) *Platform

func (*Platform) API

func (p *Platform) API() *api.Version

type ProjectMetadata

type ProjectMetadata struct {
	Source *ProjectSource `toml:"source" json:"source,omitempty"`
}

type ProjectSource

type ProjectSource struct {
	Type     string                 `toml:"type" json:"type,omitempty"`
	Version  map[string]interface{} `toml:"version" json:"version,omitempty"`
	Metadata map[string]interface{} `toml:"metadata" json:"metadata,omitempty"`
}

type RunImageMetadata

type RunImageMetadata struct {
	TopLayer  string `json:"topLayer" toml:"top-layer"`
	Reference string `json:"reference" toml:"reference"`
}

type SourceMetadata

type SourceMetadata struct {
	Git GitMetadata `json:"git"`
}

type StackMetadata

type StackMetadata struct {
	RunImage StackRunImageMetadata `json:"runImage" toml:"run-image"`
}

func (*StackMetadata) BestRunImageMirror

func (sm *StackMetadata) BestRunImageMirror(registry string) (string, error)

type StackRunImageMetadata

type StackRunImageMetadata struct {
	Image   string   `toml:"image" json:"image"`
	Mirrors []string `toml:"mirrors" json:"mirrors,omitempty"`
}

Jump to

Keyboard shortcuts

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