Documentation ¶
Index ¶
- Constants
- Variables
- func ArchiveListImages(optionList ...Option) error
- func ArchivePack(optionList ...Option) error
- func ArchivePush(optionList ...Option) error
- func ArchiveRelocate(optionList ...Option) error
- func ArchiveShowManifests(optionList ...Option) error
- func ConfigDeleteUDI(optionList ...Option) error
- func ConfigGet(options ...Option) error
- func ConfigPull(optionList ...Option) error
- func ConfigPush(optionList ...Option) error
- func ConfigSetUDI(optionList ...Option) error
- func Init(optionList ...Option) error
- func ManifestAdd(optionList ...Option) error
- func ManifestShow(optionList ...Option) error
- type Archiver
- type ArtifactsService
- type Bundle
- type BundleConfig
- type BundleConfigCodec
- type BundleConfigFactory
- type BundleConfigWriter
- type BundleCreatorFunc
- type BundleFactory
- type BundleFactoryFunc
- type BundleImage
- type BundleImager
- type BundleManifest
- type BundlePacker
- type Codec
- type Decoder
- type Encoder
- type ImageReader
- type ImageRelocator
- type ImageReplacer
- type ImageService
- type ImageWriter
- type ManifestGenerator
- type ManifestService
- type Option
- func WithArchive(archive string) Option
- func WithArchiver(archiver Archiver) Option
- func WithBundleConfigCodec(bcc BundleConfigCodec) Option
- func WithBundleConfigFactory(fn BundleConfigFactory) Option
- func WithBundleConfigWriter(bcw BundleConfigWriter) Option
- func WithBundleCreator(fn BundleCreatorFunc) Option
- func WithBundleFactory(fn BundleFactoryFunc) Option
- func WithBundleImager(bi BundleImager) Option
- func WithBundleName(name string) Option
- func WithBundlePacker(bp BundlePacker) Option
- func WithBundlePath(s string) Option
- func WithBundleVersion(version string) Option
- func WithCodec(c Codec) Option
- func WithDestination(dest string) Option
- func WithDryRun(dryRun bool) Option
- func WithFilePaths(filePaths []string) Option
- func WithForce(force bool) Option
- func WithImageReader(ir ImageReader) Option
- func WithImageRelocator(ir ImageRelocator) Option
- func WithImageReplacer(ir ImageReplacer) Option
- func WithImageWriter(iw ImageWriter) Option
- func WithImages(imageList []string) Option
- func WithReference(ref string) Option
- func WithReporter(r reporter.Reporter) Option
- func WithRepositoryPrefix(prefix string) Option
- func WithUserDefinedImage(udi UserDefinedImage) Option
- func WithUserDefinedImageKey(udiKey UserDefinedImageKey) Option
- func WithWriter(w io.Writer) Option
- type UserDefinedImage
- type UserDefinedImageKey
- type UserDefinedImageType
Constants ¶
const ( // BundleConfigFilename is the filename for a fs config. BundleConfigFilename = "bundle.json" // BundleConfigDefaultVersion is the default version a bundle. BundleConfigDefaultVersion = "0.1.0" )
Variables ¶
var UserDefinedImageTypes = []string{string(MultiResult), string(SingleResult)}
UserDefinedImageTypes is a list of user defined image types as a string.
var ( // Version is the sheaf's version. Version string )
Functions ¶
func ArchiveListImages ¶
ArchiveListImages lists images in an archive.
func ArchivePush ¶
ArchivePush push an archive's bundle to a registry.
func ArchiveRelocate ¶
ArchiveRelocate relocates images to an archive to a registry.
func ArchiveShowManifests ¶
ArchiveShowManifests shows manifests in an archive.
func ConfigDeleteUDI ¶
ConfigDeleteUDI deletes a user defined image from a bundle configuration.
func ConfigPull ¶
ConfigPull pulls a bundle from a registry.
func ConfigPush ¶
ConfigPush pushes a bundle to a registry.
func ConfigSetUDI ¶
ConfigSetUDI sets a user defined image in the bundle config.
func ManifestAdd ¶
ManifestAdd adds manifests to a bundle.
func ManifestShow ¶
ManifestShow shows manifests in a bundle.
Types ¶
type Archiver ¶
type Archiver interface { // Archive archives a source to a writer. Archive(src string, w io.Writer) error // Unarchive unarchives a reader to a destination. Unarchive(r io.Reader, dest string) error // UnarchivePath unarchives a source to a destination. UnarchivePath(src string, dest string) error }
Archiver manages archives.
type ArtifactsService ¶
type ArtifactsService interface { Index() ([]byte, error) Image() ImageService }
ArtifactsService interacts with fs artifacts.
type Bundle ¶
type Bundle interface { Codec() Codec Path() string Config() BundleConfig Artifacts() ArtifactsService Manifests() (ManifestService, error) Images() (images.Set, error) Copy(dest string) (Bundle, error) }
Bundle manages bundles.
type BundleConfig ¶
type BundleConfig interface { GetSchemaVersion() string SetSchemaVersion(string) GetName() string SetName(string) GetVersion() string SetVersion(string) GetUserDefinedImages() []UserDefinedImage SetUserDefinedImages([]UserDefinedImage) }
BundleConfig is a bundle configuration interface.
type BundleConfigCodec ¶
type BundleConfigCodec interface { // Encode encodes a bundle config to a writer. Encode(w io.Writer, bc BundleConfig) error // Decode decodes a bundle config from a reader. Decode(r io.Reader) (BundleConfig, error) }
BundleConfigCodec is a codec for bundle config.
type BundleConfigFactory ¶
type BundleConfigFactory func() BundleConfig
BundleConfigFactory is a function that creates a bundle config.
type BundleConfigWriter ¶
type BundleConfigWriter interface {
Write(Bundle, BundleConfig) error
}
BundleConfigWriter writes a bundle config.
type BundleCreatorFunc ¶
type BundleCreatorFunc func(bc BundleConfig) error
BundleCreatorFunc is a function a function that creates a bundle.
type BundleFactory ¶
BundleFactory is a factory for creating bundles given a URI.
type BundleFactoryFunc ¶
BundleFactoryFunc is a factory that creates bundle instances.
type BundleImage ¶
type BundleImage struct { Name string `json:"name"` Digest string `json:"digest"` MediaType string `json:"mediaType"` }
BundleImage is an image in a fs.
type BundleImager ¶
type BundleImager interface { // CreateImage creates an image from a bundle. CreateImage(b Bundle) (v1.Image, error) }
BundleImager is an interface that wraps the create image from bundle functionality.
type BundleManifest ¶
BundleManifest describes a manifest in a fs.
type BundlePacker ¶
type BundlePacker interface { // Pack packs a bundle to a destination. Pack(b Bundle, dest string, force bool) error }
BundlePacker is an interface wrapping the bundle pack command.
type ImageReader ¶
type ImageReader interface { // Read fetches an image given a reference. Read(refStr string) (v1.Image, error) }
ImageReader is an interface that wraps reading an image from a registry.
type ImageRelocator ¶
type ImageRelocator interface {
Relocate(rootPath, prefix string, images []image.Name, iw ImageWriter) error
}
ImageRelocator relocates an images to another registry.
type ImageReplacer ¶
type ImageReplacer interface { // Replace replaces images in a bundle manifest with prefixed options. Replace(manifest BundleManifest, config BundleConfig, prefix string) ([]byte, error) }
ImageReplacer is an interface that wraps images replacing.
type ImageService ¶
type ImageService interface {
List() ([]BundleImage, error)
}
ImageService returns a list of fs artifact images.
type ImageWriter ¶
type ImageWriter interface { // Write writes an image to a reference location. Write(ref string, image v1.Image) error // WriteIndex writes an image index to a reference location. WriteIndex(ref string, imageIndex v1.ImageIndex) error }
ImageWriter is an interface that wraps a Write method.
type ManifestGenerator ¶
ManifestGenerator generates manifests.
type ManifestService ¶
type ManifestService interface { List() ([]BundleManifest, error) Add(overwrite bool, manifestURIs ...string) error }
ManifestService is a service for interacting with manifests.
type Option ¶
type Option func(o *options)
Option is a functional option for configuring a sheaf command.
func WithBundleConfigCodec ¶
func WithBundleConfigCodec(bcc BundleConfigCodec) Option
WithBundleConfigCodec sets bundle config codec.
func WithBundleConfigFactory ¶
func WithBundleConfigFactory(fn BundleConfigFactory) Option
WithBundleConfigFactory sets the bundle config factory.
func WithBundleConfigWriter ¶
func WithBundleConfigWriter(bcw BundleConfigWriter) Option
WithBundleConfigWriter sets the bundle config writer..
func WithBundleCreator ¶
func WithBundleCreator(fn BundleCreatorFunc) Option
WithBundleCreator sets bundle creator.
func WithBundleFactory ¶
func WithBundleFactory(fn BundleFactoryFunc) Option
WithBundleFactory sets the bundle factory.
func WithBundleImager ¶
func WithBundleImager(bi BundleImager) Option
WithBundleImager sets the bundle imager.
func WithBundlePacker ¶
func WithBundlePacker(bp BundlePacker) Option
WithBundlePacker sets the bundle packer.
func WithBundleVersion ¶
WithBundleVersion sets bundle version.
func WithDestination ¶
WithDestination sets the destination.
func WithImageReader ¶
func WithImageReader(ir ImageReader) Option
WithImageReader sets image reader.
func WithImageRelocator ¶
func WithImageRelocator(ir ImageRelocator) Option
WithImageRelocator sets image relocator.
func WithImageReplacer ¶
func WithImageReplacer(ir ImageReplacer) Option
WithImageReplacer sets the image replacer.
func WithImageWriter ¶
func WithImageWriter(iw ImageWriter) Option
WithImageWriter sets image writer.
func WithRepositoryPrefix ¶
WithRepositoryPrefix sets the repository prefix.
func WithUserDefinedImage ¶
func WithUserDefinedImage(udi UserDefinedImage) Option
WithUserDefinedImage sets user defined image.
func WithUserDefinedImageKey ¶
func WithUserDefinedImageKey(udiKey UserDefinedImageKey) Option
WithUserDefinedImageKey sets user defined image key.
type UserDefinedImage ¶
type UserDefinedImage struct { APIVersion string `json:"apiVersion"` Kind string `json:"kind"` JSONPath string `json:"jsonPath"` }
UserDefinedImage is a user defined image. These allow sheaf to find more images.
func (UserDefinedImage) Validate ¶
func (udi UserDefinedImage) Validate() error
Validate validates a user defined image.
type UserDefinedImageKey ¶
UserDefinedImageKey is a key describing a UserDefinedImage.
type UserDefinedImageType ¶
type UserDefinedImageType string
UserDefinedImageType is the type of user defined image.
const ( // MultiResult states the JSON path will return multiple values. MultiResult UserDefinedImageType = "multiple" // SingleResult states the JSON path will return a single value. SingleResult UserDefinedImageType = "single" )
Source Files ¶
- archive_list_images.go
- archive_pack.go
- archive_push.go
- archive_relocate.go
- archive_show_manifests.go
- archiver.go
- bundle.go
- bundle_config.go
- bundle_imager.go
- codec.go
- config_delete_udi.go
- config_get.go
- config_pull.go
- config_push.go
- config_set_udi.go
- core.go
- image_reader.go
- image_replacer.go
- image_writer.go
- init.go
- manifest_add.go
- manifest_show.go
- option.go
- user_defined_image.go
- version.go