Documentation ¶
Index ¶
- Constants
- type APISet
- type APIVersions
- type Blob
- type Builder
- func (b *Builder) AddBuildpack(bp dist.Buildpack)
- func (b *Builder) Buildpacks() []dist.BuildpackInfo
- func (b *Builder) CreatedBy() CreatorMetadata
- func (b *Builder) Description() string
- func (b *Builder) GID() int
- func (b *Builder) Image() imgutil.Image
- func (b *Builder) LifecycleDescriptor() LifecycleDescriptor
- func (b *Builder) Mixins() []string
- func (b *Builder) Name() string
- func (b *Builder) Order() dist.Order
- func (b *Builder) Save(logger logging.Logger, creatorMetadata CreatorMetadata) error
- func (b *Builder) SetDescription(description string)
- func (b *Builder) SetEnv(env map[string]string)
- func (b *Builder) SetLifecycle(lifecycle Lifecycle)
- func (b *Builder) SetOrder(order dist.Order)
- func (b *Builder) SetStack(stackConfig builder.StackConfig)
- func (b *Builder) Stack() StackMetadata
- func (b *Builder) UID() int
- type CreatorMetadata
- type DetectionCalculator
- type DetectionOrderCalculator
- type ImageFetcher
- type ImageFetcherWrapper
- type Info
- type Inspectable
- type InspectableFetcher
- type Inspector
- type LabelInspector
- type LabelManager
- type LabelManagerFactory
- type LabelManagerProvider
- type Lifecycle
- type LifecycleAPI
- type LifecycleAPIs
- type LifecycleDescriptor
- type LifecycleInfo
- type LifecycleMetadata
- type Metadata
- type RunImageMetadata
- type StackMetadata
- type Version
Constants ¶
const ( EnvUID = "CNB_USER_ID" EnvGID = "CNB_GROUP_ID" )
const ( DefaultLifecycleVersion = "0.9.3" DefaultBuildpackAPIVersion = "0.2" )
A snapshot of the latest tested lifecycle version values
const (
OrderLabel = "io.buildpacks.buildpack.order"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIVersions ¶
type APIVersions struct { Deprecated APISet `toml:"deprecated" json:"deprecated" yaml:"deprecated"` Supported APISet `toml:"supported" json:"supported" yaml:"supported"` }
APIVersions describes the supported API versions
type Blob ¶
type Blob interface {
Open() (io.ReadCloser, error)
}
Blob is an interface to wrap opening blobs
type Builder ¶
type Builder struct { StackID string // contains filtered or unexported fields }
Builder represents a pack builder, used to build images
func (*Builder) AddBuildpack ¶
AddBuildpack adds a buildpack to the builder
func (*Builder) Buildpacks ¶
func (b *Builder) Buildpacks() []dist.BuildpackInfo
Buildpacks returns the buildpack list
func (*Builder) CreatedBy ¶
func (b *Builder) CreatedBy() CreatorMetadata
CreatedBy returns metadata around the creation of the builder
func (*Builder) Description ¶
Description returns the builder description
func (*Builder) LifecycleDescriptor ¶
func (b *Builder) LifecycleDescriptor() LifecycleDescriptor
LifecycleDescriptor returns the LifecycleDescriptor
func (*Builder) Save ¶
func (b *Builder) Save(logger logging.Logger, creatorMetadata CreatorMetadata) error
Save saves the builder
func (*Builder) SetDescription ¶
SetDescription sets the description of the builder
func (*Builder) SetLifecycle ¶
SetLifecycle sets the lifecycle of the builder
func (*Builder) SetStack ¶
func (b *Builder) SetStack(stackConfig builder.StackConfig)
SetStack sets the stack of the builder
type CreatorMetadata ¶
type DetectionCalculator ¶
type DetectionCalculator interface {
Order(topOrder dist.Order, layers dist.BuildpackLayers, depth int) (pubbldr.DetectionOrder, error)
}
type DetectionOrderCalculator ¶
type DetectionOrderCalculator struct{}
func NewDetectionOrderCalculator ¶
func NewDetectionOrderCalculator() *DetectionOrderCalculator
func (*DetectionOrderCalculator) Order ¶
func (c *DetectionOrderCalculator) Order( order dist.Order, layers dist.BuildpackLayers, maxDepth int, ) (pubbldr.DetectionOrder, error)
type ImageFetcher ¶
type ImageFetcher interface { // Fetch fetches an image by resolving it both remotely and locally depending on provided parameters. // If daemon is true, it will look return a `local.Image`. Pull, applicable only when daemon is true, will // attempt to pull a remote image first. Fetch(ctx context.Context, name string, daemon bool, pullPolicy pubcfg.PullPolicy) (imgutil.Image, error) }
type ImageFetcherWrapper ¶
type ImageFetcherWrapper struct {
// contains filtered or unexported fields
}
func NewImageFetcherWrapper ¶
func NewImageFetcherWrapper(fetcher ImageFetcher) *ImageFetcherWrapper
func (*ImageFetcherWrapper) Fetch ¶
func (w *ImageFetcherWrapper) Fetch( ctx context.Context, name string, daemon bool, pullPolicy pubcfg.PullPolicy, ) (Inspectable, error)
type Info ¶
type Info struct { Description string StackID string Mixins []string RunImage string RunImageMirrors []string Buildpacks []dist.BuildpackInfo Order pubbldr.DetectionOrder BuildpackLayers dist.BuildpackLayers Lifecycle LifecycleDescriptor CreatedBy CreatorMetadata }
type Inspectable ¶
type InspectableFetcher ¶
type InspectableFetcher interface {
Fetch(ctx context.Context, name string, daemon bool, pullPolicy config.PullPolicy) (Inspectable, error)
}
type Inspector ¶
type Inspector struct {
// contains filtered or unexported fields
}
func NewInspector ¶
func NewInspector(fetcher InspectableFetcher, factory LabelManagerFactory, calculator DetectionCalculator) *Inspector
type LabelInspector ¶
type LabelManager ¶
type LabelManager struct {
// contains filtered or unexported fields
}
func NewLabelManager ¶
func NewLabelManager(inspectable Inspectable) *LabelManager
func (*LabelManager) BuildpackLayers ¶
func (m *LabelManager) BuildpackLayers() (dist.BuildpackLayers, error)
func (*LabelManager) Metadata ¶
func (m *LabelManager) Metadata() (Metadata, error)
func (*LabelManager) Mixins ¶
func (m *LabelManager) Mixins() ([]string, error)
func (*LabelManager) StackID ¶
func (m *LabelManager) StackID() (string, error)
type LabelManagerFactory ¶
type LabelManagerFactory interface {
BuilderLabelManager(inspectable Inspectable) LabelInspector
}
type LabelManagerProvider ¶
type LabelManagerProvider struct{}
func NewLabelManagerProvider ¶
func NewLabelManagerProvider() *LabelManagerProvider
func (*LabelManagerProvider) BuilderLabelManager ¶
func (p *LabelManagerProvider) BuilderLabelManager(inspectable Inspectable) LabelInspector
type Lifecycle ¶
type Lifecycle interface { Blob Descriptor() LifecycleDescriptor }
Lifecycle is an implementation of the CNB Lifecycle spec
func NewLifecycle ¶
NewLifecycle creates a Lifecycle from a Blob
type LifecycleAPI ¶
type LifecycleAPI struct { BuildpackVersion *api.Version `toml:"buildpack" json:"buildpack"` PlatformVersion *api.Version `toml:"platform" json:"platform"` }
LifecycleAPI describes which API versions the lifecycle satisfies
type LifecycleAPIs ¶
type LifecycleAPIs struct { Buildpack APIVersions `toml:"buildpack" json:"buildpack"` Platform APIVersions `toml:"platform" json:"platform"` }
LifecycleAPIs describes the supported API versions per specification
type LifecycleDescriptor ¶
type LifecycleDescriptor struct { Info LifecycleInfo `toml:"lifecycle"` // Deprecated: Use `LifecycleAPIs` instead API LifecycleAPI `toml:"api"` APIs LifecycleAPIs `toml:"apis"` }
LifecycleDescriptor contains information described in the lifecycle.toml
func CompatDescriptor ¶
func CompatDescriptor(descriptor LifecycleDescriptor) LifecycleDescriptor
CompatDescriptor provides compatibility by mapping new fields to old and vice-versa
func ParseDescriptor ¶
func ParseDescriptor(contents string) (LifecycleDescriptor, error)
ParseDescriptor parses LifecycleDescriptor from toml formatted string.
type LifecycleInfo ¶
type LifecycleInfo struct {
Version *Version `toml:"version" json:"version" yaml:"version"`
}
LifecycleInfo contains information about the lifecycle
type LifecycleMetadata ¶
type LifecycleMetadata struct { LifecycleInfo // Deprecated: use APIs instead API LifecycleAPI `json:"api"` APIs LifecycleAPIs `json:"apis"` }
type Metadata ¶
type Metadata struct { Description string `json:"description"` Buildpacks []dist.BuildpackInfo `json:"buildpacks"` Stack StackMetadata `json:"stack"` Lifecycle LifecycleMetadata `json:"lifecycle"` CreatedBy CreatorMetadata `json:"createdBy"` }
type RunImageMetadata ¶
type StackMetadata ¶
type StackMetadata struct {
RunImage RunImageMetadata `json:"runImage" toml:"run-image"`
}
type Version ¶
Version is an extension to semver.Version to make it marshalable.
func VersionMustParse ¶
VersionMustParse parses a string into a Version
func (*Version) MarshalText ¶
MarshalText makes Version satisfy the encoding.TextMarshaler interface.
func (*Version) UnmarshalText ¶
UnmarshalText makes Version satisfy the encoding.TextUnmarshaler interface.