files

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateFiles

func ValidateFiles(files []File) error

ValidateFiles validates the Files field of the manifest.

func ValidateFilestores

func ValidateFilestores(filestores []Filestore) error

ValidateFilestores validates the Filestores field of the manifest.

Types

type File

type File struct {
	// Name is the relative path of the file, relative to the Filestore base
	Name string `json:"name"`
	// SHA256 holds the SHA256 hash of the specified file (hex encoded)
	SHA256 string `json:"sha256,omitempty"`
}

File holds information about a file artifact. File artifacts are copied from a source Filestore to N destination Filestores.

type Filestore

type Filestore struct {
	// Base is the leading part of an artifact path, including the scheme.
	// It is everything that is not the actual file name itself.
	// e.g. "gs://prod-artifacts/myproject"
	Base           string `json:"base,omitempty"`
	ServiceAccount string `json:"service-account,omitempty"`
	Src            bool   `json:"src,omitempty"`
}

Filestore holds information about a filestore (e.g. GCS or S3 bucket), to be written in a manifest file.

type Manifest

type Manifest struct {
	// Filestores contains the source and destination (Src/Dest) filestores.
	// Filestores are (for example) GCS or S3 buckets.
	// It is possible that in the future, we support promoting to multiple
	// filestores, in which case we would have more than just Src/Dest.
	Filestores []Filestore `json:"filestores,omitempty"`
	Files      []File      `json:"files,omitempty"`
}

Manifest stores the information in a manifest file (describing the desired state of a Docker Registry).

func ParseManifest

func ParseManifest(b []byte) (*Manifest, error)

ParseManifest parses a Manifest.

func (*Manifest) Validate

func (m *Manifest) Validate() error

Validate checks for semantic errors in the yaml fields (the structure of the yaml is checked during unmarshaling).

Jump to

Keyboard shortcuts

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