cargo

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 15 Imported by: 4

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 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"`

	// Deprecated: This field is not part of the official buildpack.toml spec and
	// will therefore be removed in the next major release
	SHA256 string `toml:"-" json:"-"`
}

type ConfigBuildpackLicense added in v0.13.0

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 {
	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"`
	SourceSHA256    string        `toml:"source_sha256"    json:"source_sha256,omitempty"`
	Stacks          []string      `toml:"stacks"           json:"stacks,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 added in v0.12.0

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, checksum string) ValidatedReader

func (ValidatedReader) Read

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

func (ValidatedReader) Valid

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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