cargo

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: Apache-2.0 Imports: 16 Imported by: 82

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChecksumValidationError = errors.New("validation error: checksum does not match")

Functions

func DecodeConfig

func DecodeConfig(reader io.Reader, config *Config) error

func EncodeConfig

func EncodeConfig(writer io.Writer, config Config) error

Types

type BuildpackParser

type BuildpackParser struct{}

func NewBuildpackParser

func NewBuildpackParser() BuildpackParser

func (BuildpackParser) Parse

func (p BuildpackParser) Parse(path string) (Config, error)

type Checksum added in v2.6.0

type Checksum string

Checksum represents a checksum algorithm and hash pair formatted as algorithm:hash.

func (Checksum) Algorithm added in v2.6.0

func (c Checksum) Algorithm() string

Algorithm returns the algorithm portion of the checksum string. If that portion is missing, it defaults to "sha256".

func (Checksum) Hash added in v2.6.0

func (c Checksum) Hash() string

Hash returns the hexidecimal encoded hash portion of the checksum string.

func (Checksum) Match added in v2.6.0

func (c Checksum) Match(o Checksum) bool

EqualTo returns true only when the given checksum algorithms and hashes match.

func (Checksum) MatchString added in v2.6.0

func (c Checksum) MatchString(o string) bool

EqualTo returns true only when the given checksum formatted string algorithms and hashes match.

type Config

type Config struct {
	API       string          `toml:"api"       json:"api,omitempty"`
	Buildpack ConfigBuildpack `toml:"buildpack" json:"buildpack,omitempty"`
	Metadata  ConfigMetadata  `toml:"metadata"  json:"metadata,omitempty"`
	Stacks    []ConfigStack   `toml:"stacks"    json:"stacks,omitempty"`
	Order     []ConfigOrder   `toml:"order"     json:"order,omitempty"`
}

type ConfigBuildpack

type ConfigBuildpack struct {
	ID          string                   `toml:"id"                    json:"id,omitempty"`
	Name        string                   `toml:"name"                  json:"name,omitempty"`
	Version     string                   `toml:"version"               json:"version,omitempty"`
	Homepage    string                   `toml:"homepage,omitempty"    json:"homepage,omitempty"`
	ClearEnv    bool                     `toml:"clear-env,omitempty"   json:"clear-env,omitempty"`
	Description string                   `toml:"description,omitempty" json:"description,omitempty"`
	Keywords    []string                 `toml:"keywords,omitempty"    json:"keywords,omitempty"`
	Licenses    []ConfigBuildpackLicense `toml:"licenses,omitempty"    json:"licenses,omitempty"`
	SBOMFormats []string                 `toml:"sbom-formats,omitempty"    json:"sbom-formats,omitempty"`
}

type ConfigBuildpackLicense

type ConfigBuildpackLicense struct {
	Type string `toml:"type" json:"type"`
	URI  string `toml:"uri"  json:"uri"`
}

type ConfigMetadata

type ConfigMetadata struct {
	IncludeFiles          []string                             `toml:"include-files"              json:"include-files,omitempty"`
	PrePackage            string                               `toml:"pre-package"                json:"pre-package,omitempty"`
	DefaultVersions       map[string]string                    `toml:"default-versions"           json:"default-versions,omitempty"`
	Dependencies          []ConfigMetadataDependency           `toml:"dependencies"               json:"dependencies,omitempty"`
	DependencyConstraints []ConfigMetadataDependencyConstraint `toml:"dependency-constraints"     json:"dependency-constraints,omitempty"`
	Unstructured          map[string]interface{}               `toml:"-"                          json:"-"`
}

func (ConfigMetadata) MarshalJSON

func (m ConfigMetadata) MarshalJSON() ([]byte, error)

func (*ConfigMetadata) UnmarshalJSON

func (m *ConfigMetadata) UnmarshalJSON(data []byte) error

type ConfigMetadataDependency

type ConfigMetadataDependency struct {
	Checksum        string        `toml:"checksum"         json:"checksum,omitempty"`
	CPE             string        `toml:"cpe"              json:"cpe,omitempty"`
	PURL            string        `toml:"purl"             json:"purl,omitempty"`
	DeprecationDate *time.Time    `toml:"deprecation_date" json:"deprecation_date,omitempty"`
	ID              string        `toml:"id"               json:"id,omitempty"`
	Licenses        []interface{} `toml:"licenses"         json:"licenses,omitempty"`
	Name            string        `toml:"name"             json:"name,omitempty"`
	SHA256          string        `toml:"sha256"           json:"sha256,omitempty"`
	Source          string        `toml:"source"           json:"source,omitempty"`
	SourceChecksum  string        `toml:"source-checksum"  json:"source-checksum,omitempty"`
	SourceSHA256    string        `toml:"source_sha256"    json:"source_sha256,omitempty"`
	Stacks          []string      `toml:"stacks"           json:"stacks,omitempty"`
	StripComponents int           `toml:"strip-components" json:"strip-components,omitempty"`
	URI             string        `toml:"uri"              json:"uri,omitempty"`
	Version         string        `toml:"version"          json:"version,omitempty"`
}

func (ConfigMetadataDependency) HasStack

func (cd ConfigMetadataDependency) HasStack(stack string) bool

type ConfigMetadataDependencyConstraint

type ConfigMetadataDependencyConstraint struct {
	Constraint string `toml:"constraint"       json:"constraint,omitempty"`
	ID         string `toml:"id"               json:"id,omitempty"`
	Patches    int    `toml:"patches"          json:"patches,omitempty"`
}

type ConfigOrder

type ConfigOrder struct {
	Group []ConfigOrderGroup `toml:"group" json:"group,omitempty"`
}

type ConfigOrderGroup

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

type ConfigStack

type ConfigStack struct {
	ID     string   `toml:"id"     json:"id,omitempty"`
	Mixins []string `toml:"mixins" json:"mixins,omitempty"`
}

type DirectoryDuplicator

type DirectoryDuplicator struct{}

func NewDirectoryDuplicator

func NewDirectoryDuplicator() DirectoryDuplicator

func (DirectoryDuplicator) Duplicate

func (d DirectoryDuplicator) Duplicate(source, destination string) error

type Transport

type Transport struct{}

func NewTransport

func NewTransport() Transport

func (Transport) Drop

func (t Transport) Drop(root, uri string) (io.ReadCloser, error)

type ValidatedReader

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

func NewValidatedReader

func NewValidatedReader(reader io.Reader, sum string) ValidatedReader

func (ValidatedReader) Read

func (vr ValidatedReader) Read(p []byte) (int, error)

func (ValidatedReader) Valid

func (vr ValidatedReader) Valid() (bool, error)

Jump to

Keyboard shortcuts

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