xpkg

package
v0.30.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONPackageParser

type JSONPackageParser interface {
	Parse(context.Context, io.ReadCloser) (*ndjson.Package, error)
}

JSONPackageParser defines the API contract for working with a PackageParser.

type Marshaler

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

Marshaler represents a xpkg Marshaler

func NewMarshaler

func NewMarshaler(opts ...MarshalerOption) (*Marshaler, error)

NewMarshaler returns a new Marshaler

func (*Marshaler) FromDir

func (r *Marshaler) FromDir(fs afero.Fs, path string) (*ParsedPackage, error)

FromDir takes an afero.Fs and a path to a directory and returns a ParsedPackage based on the directories contents for consumption by upstream callers.

func (*Marshaler) FromImage

func (r *Marshaler) FromImage(i xpkg.Image) (*ParsedPackage, error)

FromImage takes a xpkg.Image and returns a ParsedPackage for consumption by upstream callers.

type MarshalerOption

type MarshalerOption func(*Marshaler)

MarshalerOption modifies the xpkg Marshaler

func WithJSONParser

func WithJSONParser(p JSONPackageParser) MarshalerOption

WithJSONParser modifies the Marshaler by setting the supplied PackageParser as the Resolver's parser.

func WithYamlParser

func WithYamlParser(p parser.Parser) MarshalerOption

WithYamlParser modifies the Marshaler by setting the supplied PackageParser as the Resolver's parser.

type ParsedPackage

type ParsedPackage struct {
	// The package dependencies derived from .Spec.DependsOn.
	Deps []v1beta1.Dependency
	// The MetaObj file that corresponds to the package.
	MetaObj runtime.Object
	// The name of the package. This name maps to the package name defined
	// in the crossplane.yaml and is represented in the directory name for
	// the package on the filesystem.
	DepName string
	// The N corresponding Objs (CRDs, XRDs, Compositions) depending on the package type.
	Objs []runtime.Object
	// The type of Package.
	PType v1beta1.PackageType
	// The container registry.
	Reg string
	// The SHA corresponding to the package.
	SHA string
	// The resolved version, e.g. v0.20.0
	Ver string
}

ParsedPackage represents an xpkg that has been parsed from a v1.Image

func (*ParsedPackage) Dependencies

func (p *ParsedPackage) Dependencies() []v1beta1.Dependency

Dependencies returns the package's dependencies.

func (*ParsedPackage) Digest

func (p *ParsedPackage) Digest() string

Digest returns the package's digest derived from the package image.

func (*ParsedPackage) Meta

func (p *ParsedPackage) Meta() runtime.Object

Meta returns the runtime.Object corresponding to the meta file.

func (*ParsedPackage) Name

func (p *ParsedPackage) Name() string

Name returns the name of the package. e.g. crossplane/provider-aws.

func (*ParsedPackage) Objects

func (p *ParsedPackage) Objects() []runtime.Object

Objects returns the slice of runtime.Objects corresponding to CRDs, XRDs, and Compositions contained in the package.

func (*ParsedPackage) Registry

func (p *ParsedPackage) Registry() string

Registry returns the registry path where the package image is located. e.g. index.docker.io/crossplane/provider-aws

func (*ParsedPackage) Type

func (p *ParsedPackage) Type() v1beta1.PackageType

Type returns the package's type.

func (*ParsedPackage) Version

func (p *ParsedPackage) Version() string

Version returns the version for the package image. e.g. v0.20.0

Jump to

Keyboard shortcuts

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