internal

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindDependencyName

func FindDependencyName(dependencyID string, config cargo.Config) string

FindDependencyName returns the name of a Dependency in a cargo.Config that has a matching ID with a given dependency ID.

func GetBuildpackageID

func GetBuildpackageID(uri string) (string, error)

func GetCargoDependenciesWithinConstraint

func GetCargoDependenciesWithinConstraint(dependencies []cargo.ConfigMetadataDependency, constraint cargo.ConfigMetadataDependencyConstraint) ([]cargo.ConfigMetadataDependency, error)

GetCargoDependenciesWithinConstraint receives cargo ConfigMetadataDependencies and a cargo DependencyConstraint. It returns a filtered list of dependencies that match the constraint and ID, in order of lowest version to highest. It will include version duplicates if their targets differ, and duplicates do not contribute to the number of patches in the constraints.

func GetDependenciesWithinConstraint

func GetDependenciesWithinConstraint(dependencies []Dependency, constraint cargo.ConfigMetadataDependencyConstraint, dependencyName string) ([]cargo.ConfigMetadataDependency, error)

func OverwriteBuilderConfig

func OverwriteBuilderConfig(path string, config BuilderConfig) error

func OverwriteBuildpackConfig

func OverwriteBuildpackConfig(path string, config BuildpackConfig) error

func OverwritePackageConfig

func OverwritePackageConfig(path string, config PackageConfig) error

Types

type BuilderConfig

type BuilderConfig struct {
	Description string                   `toml:"description"`
	Buildpacks  []BuilderConfigBuildpack `toml:"buildpacks"`
	Lifecycle   BuilderConfigLifecycle   `toml:"lifecycle"`
	Order       []BuilderConfigOrder     `toml:"order"`
	Stack       BuilderConfigStack       `toml:"stack"`
}

func ParseBuilderConfig

func ParseBuilderConfig(path string) (BuilderConfig, error)

type BuilderConfigBuildpack

type BuilderConfigBuildpack struct {
	URI     string `toml:"uri"`
	Version string `toml:"version"`
}

func (*BuilderConfigBuildpack) UnmarshalTOML

func (b *BuilderConfigBuildpack) UnmarshalTOML(v interface{}) error

Note: this is to support that buildpackages can refer to this field as `image` or `uri`.

type BuilderConfigLifecycle

type BuilderConfigLifecycle struct {
	Version string `toml:"version"`
}

type BuilderConfigOrder

type BuilderConfigOrder struct {
	Group []BuilderConfigOrderGroup `toml:"group"`
}

type BuilderConfigOrderGroup

type BuilderConfigOrderGroup struct {
	ID       string `toml:"id"`
	Version  string `toml:"version,omitempty"`
	Optional bool   `toml:"optional,omitempty"`
}

type BuilderConfigStack

type BuilderConfigStack struct {
	ID              string   `toml:"id"`
	BuildImage      string   `toml:"build-image"`
	RunImage        string   `toml:"run-image"`
	RunImageMirrors []string `toml:"run-image-mirrors"`
}

type BuildpackConfig

type BuildpackConfig struct {
	API       interface{}            `toml:"api"`
	Buildpack interface{}            `toml:"buildpack"`
	Metadata  interface{}            `toml:"metadata"`
	Order     []BuildpackConfigOrder `toml:"order"`
}

func ParseBuildpackConfig

func ParseBuildpackConfig(path string) (BuildpackConfig, error)

type BuildpackConfigOrder

type BuildpackConfigOrder struct {
	Group []BuildpackConfigOrderGroup `toml:"group"`
}

type BuildpackConfigOrderGroup

type BuildpackConfigOrderGroup struct {
	ID       string `toml:"id"`
	Version  string `toml:"version,omitempty"`
	Optional bool   `toml:"optional,omitempty"`
}

type BuildpackInspector

type BuildpackInspector struct{}

func NewBuildpackInspector

func NewBuildpackInspector() BuildpackInspector

func (BuildpackInspector) Dependencies

func (i BuildpackInspector) Dependencies(path string) ([]BuildpackMetadata, error)

type BuildpackMetadata

type BuildpackMetadata struct {
	Config cargo.Config
	SHA256 string
}

type Dependency

type Dependency struct {
	DeprecationDate string `json:"deprecation_date,omitempty"`
	// The ID field should be the `name` from the dep-server
	ID string `json:"name,omitempty"`
	// Deprecated: use Checksum instead.
	SHA256 string `json:"sha256,omitempty"`
	Source string `json:"source,omitempty"`
	// Deprecated: use SourceChecksum instead.
	SourceSHA256   string   `json:"source_sha256,omitempty"`
	Stacks         []Stack  `json:"stacks,omitempty"`
	URI            string   `json:"uri,omitempty"`
	Version        string   `json:"version,omitempty"`
	CreatedAt      string   `json:"created_at,omitempty"`
	ModifedAt      string   `json:"modified_at,omitempty"`
	CPE            string   `json:"cpe,omitempty"`
	PURL           string   `json:"purl,omitempty"`
	Licenses       []string `json:"licenses,omitempty"`
	Checksum       string   `json:"checksum,omitempty"`
	SourceChecksum string   `json:"source-checksum,omitempty"`
}

Dependency represents the structure of a single entry in the dep-server

func GetAllDependencies

func GetAllDependencies(api, dependencyID string) ([]Dependency, error)

GetDependencies returns all dependencies from a given API endpoint

type DependencyCacher

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

func NewDependencyCacher

func NewDependencyCacher(downloader Downloader, logger scribe.Logger) DependencyCacher

func (DependencyCacher) Cache

type Downloader

type Downloader interface {
	Drop(root, uri string) (io.ReadCloser, error)
}

type Executable

type Executable interface {
	Execute(execution pexec.Execution) error
}

type File

type File struct {
	io.ReadCloser

	Name string
	Info os.FileInfo
	Link string
}

type FileBundler

type FileBundler struct{}

func NewFileBundler

func NewFileBundler() FileBundler

func (FileBundler) Bundle

func (b FileBundler) Bundle(root string, paths []string, config cargo.Config) ([]File, error)

type FileInfo

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

func NewFileInfo

func NewFileInfo(name string, size int, mode os.FileMode, mtime time.Time) FileInfo

func (FileInfo) IsDir

func (fi FileInfo) IsDir() bool

func (FileInfo) ModTime

func (fi FileInfo) ModTime() time.Time

func (FileInfo) Mode

func (fi FileInfo) Mode() os.FileMode

func (FileInfo) Name

func (fi FileInfo) Name() string

func (FileInfo) Size

func (fi FileInfo) Size() int64

func (FileInfo) Sys

func (fi FileInfo) Sys() interface{}

type Formatter

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

func NewFormatter

func NewFormatter(writer io.Writer) Formatter

func (Formatter) JSON

func (f Formatter) JSON(entries []BuildpackMetadata)

func (Formatter) Markdown

func (f Formatter) Markdown(entries []BuildpackMetadata)

type Image

type Image struct {
	Name    string
	Path    string
	Version string
}

func FindLatestBuildImage

func FindLatestBuildImage(runURI, buildURI string) (Image, error)

func FindLatestImage

func FindLatestImage(uri string) (Image, error)

func FindLatestImageOnCNBRegistry

func FindLatestImageOnCNBRegistry(uri, api string) (Image, error)

type PackageConfig

type PackageConfig struct {
	Buildpack    interface{}               `toml:"buildpack"`
	Dependencies []PackageConfigDependency `toml:"dependencies"`
}

func ParsePackageConfig

func ParsePackageConfig(path string) (PackageConfig, error)

type PackageConfigDependency

type PackageConfigDependency struct {
	URI string `toml:"uri"`
}

func (*PackageConfigDependency) UnmarshalTOML

func (d *PackageConfigDependency) UnmarshalTOML(v interface{}) error

Note: this is to support that buildpackages can refer to this field as `image` or `uri`.

type PrePackager

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

func NewPrePackager

func NewPrePackager(executable Executable, logger scribe.Logger, output io.Writer) PrePackager

func (PrePackager) Execute

func (p PrePackager) Execute(scriptPath, rootDir string) error

type Stack

type Stack struct {
	ID string `json:"id,omitempty"`
}

type TarBuilder

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

func NewTarBuilder

func NewTarBuilder(logger scribe.Logger) TarBuilder

func (TarBuilder) Build

func (b TarBuilder) Build(path string, files []File) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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