cargo

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: Apache-2.0 Imports: 20 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"`
	Buildpack ConfigBuildpack `toml:"buildpack" json:"buildpack"`
	Metadata  ConfigMetadata  `toml:"metadata"  json:"metadata"`
	Stacks    []ConfigStack   `toml:"stacks"    json:"stacks"`
	Order     []ConfigOrder   `toml:"order"     json:"order"`
}

type ConfigBuildpack

type ConfigBuildpack struct {
	ID       string `toml:"id"                 json:"id"`
	Name     string `toml:"name"               json:"name"`
	Version  string `toml:"version"            json:"version"`
	Homepage string `toml:"homepage,omitempty" json:"homepage,omitempty"`
}

type ConfigMetadata

type ConfigMetadata struct {
	IncludeFiles    []string                   `toml:"include_files"         json:"include_files"`
	PrePackage      string                     `toml:"pre_package" json:"pre_package"`
	DefaultVersions map[string]string          `toml:"default-versions"      json:"default-versions"`
	Dependencies    []ConfigMetadataDependency `toml:"dependencies"          json:"dependencies"`
	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 {
	DeprecationDate time.Time `toml:"deprecation_date" json:"deprecation_date"`
	ID              string    `toml:"id"               json:"id"`
	Name            string    `toml:"name"             json:"name"`
	SHA256          string    `toml:"sha256"           json:"sha256"`
	Stacks          []string  `toml:"stacks"           json:"stacks"`
	URI             string    `toml:"uri"              json:"uri"`
	Version         string    `toml:"version"          json:"version"`
}

func (ConfigMetadataDependency) HasStack

func (cd ConfigMetadataDependency) HasStack(stack string) bool

type ConfigOrder

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

type ConfigOrderGroup

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

type ConfigStack

type ConfigStack struct {
	ID string `toml:"id" json:"id"`
}

type DependencyCacher

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

func NewDependencyCacher

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

func (DependencyCacher) Cache

type DirectoryDuplicator

type DirectoryDuplicator struct{}

func NewDirectoryDuplicator

func NewDirectoryDuplicator() DirectoryDuplicator

func (DirectoryDuplicator) Duplicate

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

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
}

type FileBundler

type FileBundler struct{}

func NewFileBundler

func NewFileBundler() FileBundler

func (FileBundler) Bundle

func (b FileBundler) Bundle(root string, paths []string, config 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 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

func (TarBuilder) Build

func (b TarBuilder) Build(path string, files []File) 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
jam

Jump to

Keyboard shortcuts

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