pkgcfg

package
v0.89.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package pkgcfg loads and applies schema migrations to zarf.yaml files.

Index

Constants

This section is empty.

Variables

View Source
var V1Alpha1 = Decoder[v1alpha1.ZarfPackage]{
	// contains filtered or unexported fields
}

V1Alpha1 decodes the v1alpha1 ZarfPackage schema.

View Source
var V1Beta1 = Decoder[v1beta1.Package]{
	// contains filtered or unexported fields
}

V1Beta1 decodes the v1beta1 Package schema.

Functions

func DecodeAs added in v0.88.0

func DecodeAs[T any](ctx context.Context, document Document, decoder Decoder[T]) (T, error)

DecodeAs decodes a selected document into the decoder's native package type.

func ParseAs added in v0.84.0

func ParseAs[T any](ctx context.Context, b []byte, d Decoder[T]) (T, error)

ParseAs returns the document matching the decoder's apiVersion from a package definition that may contain multiple documents, decoded into its native type.

func ParseMultiDoc added in v0.75.1

func ParseMultiDoc(ctx context.Context, b []byte) (api.Package, error)

ParseMultiDoc parses a multi doc zarf.yaml file into an operational Package. Multi doc definitions may contain one document per apiVersion; the highest-priority known version wins.

func ParseMultiDocNative added in v0.87.0

func ParseMultiDocNative(ctx context.Context, b []byte) (any, api.Package, error)

ParseMultiDocNative parses a multi-document zarf.yaml once and returns both the selected native wire definition and its operational representation.

Types

type Decoder added in v0.84.0

type Decoder[T any] struct {
	// contains filtered or unexported fields
}

Decoder decodes one apiVersion's document into its native package type T and converts that into a Package.

type Document added in v0.88.0

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

Document retains a selected definition's fields before decoding or migration.

func SelectDocument added in v0.88.0

func SelectDocument(ctx context.Context, b []byte) (Document, error)

SelectDocument parses a definition and selects the highest-priority known API version.

func (Document) APIVersion added in v0.88.0

func (d Document) APIVersion() string

APIVersion returns the selected document's normalized API version.

func (Document) Unmarshal added in v0.88.0

func (d Document) Unmarshal(v any) error

Unmarshal reads the selected document, retaining unknown fields when v is untyped.

Jump to

Keyboard shortcuts

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