Documentation
¶
Overview ¶
Package pkgcfg loads and applies schema migrations to zarf.yaml files.
Index ¶
- Variables
- func DecodeAs[T any](ctx context.Context, document Document, decoder Decoder[T]) (T, error)
- func ParseAs[T any](ctx context.Context, b []byte, d Decoder[T]) (T, error)
- func ParseMultiDoc(ctx context.Context, b []byte) (api.Package, error)
- func ParseMultiDocNative(ctx context.Context, b []byte) (any, api.Package, error)
- type Decoder
- type Document
Constants ¶
This section is empty.
Variables ¶
var V1Alpha1 = Decoder[v1alpha1.ZarfPackage]{ // contains filtered or unexported fields }
V1Alpha1 decodes the v1alpha1 ZarfPackage schema.
var V1Beta1 = Decoder[v1beta1.Package]{ // contains filtered or unexported fields }
V1Beta1 decodes the v1beta1 Package schema.
Functions ¶
func DecodeAs ¶ added in v0.88.0
DecodeAs decodes a selected document into the decoder's native package type.
func ParseAs ¶ added in v0.84.0
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
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.
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
SelectDocument parses a definition and selects the highest-priority known API version.
func (Document) APIVersion ¶ added in v0.88.0
APIVersion returns the selected document's normalized API version.