fs

package
v0.0.0-...-4e386bd Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BundleCreator

func BundleCreator(bundlePath string, options ...Option) func(bc sheaf.BundleConfig) error

BundleCreator creates a function that can create bundle configs.

func LoadBundleConfig

func LoadBundleConfig(path string) (sheaf.BundleConfig, error)

LoadBundleConfig loads a bundle config from a path on the filesystem.

Types

type ArtifactsService

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

ArtifactsService is a service for interacting with artifacts in a fs.

func NewArtifactsService

func NewArtifactsService(bundle sheaf.Bundle) *ArtifactsService

NewArtifactsService creates an instance of ArtifactsService.

func (*ArtifactsService) Image

func (s *ArtifactsService) Image() sheaf.ImageService

Image is an image service for interacting with images in the artifacts.

func (*ArtifactsService) Index

func (s *ArtifactsService) Index() ([]byte, error)

Index returns the contents of an artifact layout index.json as bytes.

type Bundle

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

Bundle is a fs that lives on a filesystem.

func NewBundle

func NewBundle(bundleDir string, options ...BundleOption) (*Bundle, error)

NewBundle creates an instance of Bundle. `rootPath` points to root directory of the fs on the filesystem.

func (*Bundle) Artifacts

func (b *Bundle) Artifacts() sheaf.ArtifactsService

Artifacts returns an artifacts service for the fs.

func (*Bundle) Codec

func (b *Bundle) Codec() sheaf.Codec

Codec is the codec for the fs.

func (*Bundle) Config

func (b *Bundle) Config() sheaf.BundleConfig

Config returns the configuration for the fs.

func (*Bundle) Copy

func (b *Bundle) Copy(dest string) (sheaf.Bundle, error)

Copy copies the bundle to a new path and returns a new bundle.

func (*Bundle) Images

func (b *Bundle) Images() (images.Set, error)

Images returns images in the fs.

func (*Bundle) Manifests

func (b *Bundle) Manifests() (sheaf.ManifestService, error)

Manifests returns the manifest service for the bundle.

func (*Bundle) Path

func (b *Bundle) Path() string

Path returns the root path of the fs.

type BundleConfig

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

BundleConfig is a bundle configuration.

func NewBundleConfig

func NewBundleConfig(name, version string) *BundleConfig

NewBundleConfig creates a BundleConfig.

func (BundleConfig) GetName

func (b BundleConfig) GetName() string

GetName returns the bundle config's name.

func (BundleConfig) GetSchemaVersion

func (b BundleConfig) GetSchemaVersion() string

GetSchemaVersion returns the bundle config's schema version.

func (BundleConfig) GetUserDefinedImages

func (b BundleConfig) GetUserDefinedImages() []sheaf.UserDefinedImage

GetUserDefinedImages returns the bundle config's user defined images.

func (BundleConfig) GetVersion

func (b BundleConfig) GetVersion() string

GetVersion returns the bundle config's version.

func (*BundleConfig) SetName

func (b *BundleConfig) SetName(name string)

SetName sets the bundle config's name.

func (*BundleConfig) SetSchemaVersion

func (b *BundleConfig) SetSchemaVersion(schemaVersion string)

SetSchemaVersion sets the bundle config's schema version.

func (*BundleConfig) SetUserDefinedImages

func (b *BundleConfig) SetUserDefinedImages(userDefinedImages []sheaf.UserDefinedImage)

SetUserDefinedImages sets the bundle config's user defined images.

func (*BundleConfig) SetVersion

func (b *BundleConfig) SetVersion(version string)

SetVersion sets the bundle config's version.

type BundleConfigCodec

type BundleConfigCodec struct {
}

BundleConfigCodec is a codec for encoding/decoding bundle configs.

func NewBundleConfigCodec

func NewBundleConfigCodec() *BundleConfigCodec

NewBundleConfigCodec creates an instance of BundleConfigCodec.

func (BundleConfigCodec) Decode

Decode decodes b bundle config.

func (BundleConfigCodec) Encode

Encode encodes a bundle config.

type BundleConfigWriter

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

BundleConfigWriter writes a bundle config to the filesystem.

func NewBundleConfigWriter

func NewBundleConfigWriter(options ...BundleConfigWriterOption) *BundleConfigWriter

NewBundleConfigWriter creates an instance of BundleConfigWriter.

func (BundleConfigWriter) Write

func (b BundleConfigWriter) Write(bundle sheaf.Bundle, config sheaf.BundleConfig) error

Write writes a bundle to the filesystem. It will use the path from the bundle argument.

type BundleConfigWriterOption

type BundleConfigWriterOption func(bcw *BundleConfigWriter)

BundleConfigWriterOption is an option for configuring BundleConfigWriter.

type BundleImager

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

BundleImager creates an image from a bundle that lives on a filesystem.

func NewBundleImager

func NewBundleImager(options ...BundleImagerOption) *BundleImager

NewBundleImager creates an instance of BundleImager.

func (BundleImager) CreateImage

func (bi BundleImager) CreateImage(b sheaf.Bundle) (v1.Image, error)

CreateImage create an image from a bundle.

type BundleImagerOption

type BundleImagerOption func(bi *BundleImager)

BundleImagerOption is a functional option for configuring BundleImager.

func BundleImagerReporter

func BundleImagerReporter(r reporter.Reporter) BundleImagerOption

BundleImagerReporter sets the reporter.

type BundleOption

type BundleOption func(b Bundle) Bundle

BundleOption is a functional option for configuring Bundle.

type BundlePacker

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

BundlePacker packs bundles that live on a filesystem.

func NewBundlePacker

func NewBundlePacker(options ...BundlePackerOption) *BundlePacker

NewBundlePacker creates an instance of BundlePacker.

func (BundlePacker) Pack

func (bp BundlePacker) Pack(b sheaf.Bundle, dest string, force bool) error

Pack packs a bundle to a filesystem destination.

type BundlePackerOption

type BundlePackerOption func(bp *BundlePacker)

BundlePackerOption is a functional option for configuring BundlePacker.

type ImageRelocator

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

ImageRelocator relocates images to a registry.

func NewImageRelocator

func NewImageRelocator(options ...ImageRelocatorOption) *ImageRelocator

NewImageRelocator creates an instance of ImageRelocator.

func (ImageRelocator) Relocate

func (i ImageRelocator) Relocate(rootPath, prefix string, images []image.Name, iw sheaf.ImageWriter) error

Relocate relocates images to a registry given a prefix.

type ImageRelocatorOption

type ImageRelocatorOption func(is ImageRelocator) ImageRelocator

ImageRelocatorOption is a functional option for configuring ImageRelocator.

func ImageRelocatorDryRun

func ImageRelocatorDryRun(dryRun bool) ImageRelocatorOption

ImageRelocatorDryRun configures ImageRelocator to do a dry run.

func ImageRelocatorLayoutFactory

func ImageRelocatorLayoutFactory(lf LayoutFactory) ImageRelocatorOption

ImageRelocatorLayoutFactory configuration the layout factory.

type ImageReplacer

type ImageReplacer struct{}

ImageReplacer replaces images in manifests on a filesystem.

func NewImageReplacer

func NewImageReplacer() *ImageReplacer

NewImageReplacer creates an instance of ImageReplacer.

func (ImageReplacer) Replace

func (i ImageReplacer) Replace(m sheaf.BundleManifest, config sheaf.BundleConfig, prefix string) ([]byte, error)

Replace replaces container images found in a bundle manifest.

type ImageService

type ImageService struct {
	ArtifactsService sheaf.ArtifactsService
	Decoder          sheaf.Decoder
}

ImageService uses an ArtifactsService to interact with images.

func NewImageService

func NewImageService(artifactsService sheaf.ArtifactsService, options ...ImageServiceOption) *ImageService

NewImageService creates an instance of ImageService.

func (*ImageService) List

func (s *ImageService) List() ([]sheaf.BundleImage, error)

List lists images from an OCI index.

type ImageServiceOption

type ImageServiceOption func(is ImageService) ImageService

ImageServiceOption is a functional option for configuration ImageService.

func ImageServiceDecoder

func ImageServiceDecoder(d sheaf.Decoder) ImageServiceOption

ImageServiceDecoder sets the decoder for ImageService.

type Layout

type Layout interface {
	registry.Layout
}

Layout manages OCI layouts.

type LayoutFactory

type LayoutFactory func(root string) (Layout, error)

LayoutFactory creates Layout given a root path.

func DefaultLayoutFactory

func DefaultLayoutFactory(options ...LayoutOptionFunc) LayoutFactory

DefaultLayoutFactory generates a LayoutFactory.

type LayoutOptionFunc

type LayoutOptionFunc func(options LayoutOptions) LayoutOptions

LayoutOptionFunc is a functional option for configuring DefaultLayoutFactory.

func DefaultLayoutFactoryInsecureSkipVerify

func DefaultLayoutFactoryInsecureSkipVerify() LayoutOptionFunc

DefaultLayoutFactoryInsecureSkipVerify configures support for insecure registries.

type LayoutOptions

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

LayoutOptions are options for DefaultLayoutFactory.

type ManifestService

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

ManifestService is a service for interacting with manifests on a filesystem.

func NewManifestService

func NewManifestService(manifestsDir string, options ...ManifestServiceOption) (*ManifestService, error)

NewManifestService creates an instance of ManifestService.

func (ManifestService) Add

func (m ManifestService) Add(overwrite bool, manifestURIs ...string) error

Add adds zero or more manifests to the filesystem.

func (ManifestService) List

func (m ManifestService) List() ([]sheaf.BundleManifest, error)

List lists manifests on the filesystem.

type ManifestServiceOption

type ManifestServiceOption func(m ManifestService) ManifestService

ManifestServiceOption is a functional option for configuration ManifestService.

func ManifestServiceReporter

func ManifestServiceReporter(r reporter.Reporter) ManifestServiceOption

ManifestServiceReporter sets the reporter.

type Option

type Option func(options *options)

Option is a functional option for configuring fs

Jump to

Keyboard shortcuts

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