Documentation ¶
Index ¶
- func FindDependencyName(dependencyID string, config cargo.Config) string
- func GetBuildpackageID(uri string) (string, error)
- func GetCargoDependenciesWithinConstraint(dependencies []cargo.ConfigMetadataDependency, ...) ([]cargo.ConfigMetadataDependency, error)
- func GetDependenciesWithinConstraint(dependencies []Dependency, constraint cargo.ConfigMetadataDependencyConstraint, ...) ([]cargo.ConfigMetadataDependency, error)
- func OverwriteBuilderConfig(path string, config BuilderConfig) error
- func OverwriteBuildpackConfig(path string, config BuildpackConfig) error
- func OverwritePackageConfig(path string, config PackageConfig) error
- type BuilderConfig
- type BuilderConfigBuildpack
- type BuilderConfigLifecycle
- type BuilderConfigOrder
- type BuilderConfigOrderGroup
- type BuilderConfigStack
- type BuildpackConfig
- type BuildpackConfigOrder
- type BuildpackConfigOrderGroup
- type BuildpackInspector
- type BuildpackMetadata
- type Dependency
- type DependencyCacher
- type Downloader
- type Executable
- type File
- type FileBundler
- type FileInfo
- type Formatter
- type Image
- type PackageConfig
- type PackageConfigDependency
- type PrePackager
- type Stack
- type TarBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindDependencyName ¶
FindDependencyName returns the name of a Dependency in a cargo.Config that has a matching ID with a given dependency ID.
func GetBuildpackageID ¶
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 ¶
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 BuilderConfigStack ¶
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 BuildpackInspector ¶
type BuildpackInspector struct{}
func NewBuildpackInspector ¶
func NewBuildpackInspector() BuildpackInspector
func (BuildpackInspector) Dependencies ¶
func (i BuildpackInspector) Dependencies(path string) ([]BuildpackMetadata, error)
type BuildpackMetadata ¶
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 ¶
func (dc DependencyCacher) Cache(root string, deps []cargo.ConfigMetadataDependency) ([]cargo.ConfigMetadataDependency, error)
type Downloader ¶
type Downloader interface {
Drop(root, uri string) (io.ReadCloser, error)
}
type Executable ¶
type FileBundler ¶
type FileBundler struct{}
func NewFileBundler ¶
func NewFileBundler() FileBundler
type FileInfo ¶
type FileInfo struct {
// contains filtered or unexported fields
}
func NewFileInfo ¶
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
func NewFormatter ¶
func (Formatter) JSON ¶
func (f Formatter) JSON(entries []BuildpackMetadata)
func (Formatter) Markdown ¶
func (f Formatter) Markdown(entries []BuildpackMetadata)
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 TarBuilder ¶
type TarBuilder struct {
// contains filtered or unexported fields
}
func NewTarBuilder ¶
func NewTarBuilder(logger scribe.Logger) TarBuilder