decode

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KindTemplate   = "Template"   // the value of the "kind" field in a spec.yaml file
	KindGoldenTest = "GoldenTest" // ... a test.yaml file
	KindManifest   = "Manifest"   // ... a manifest.yaml file
)

Functions

func Decode

func Decode(r io.Reader, filename, requireKind string, isReleaseBuild bool) (model.ValidatorUpgrader, string, error)

Decode parses the given YAML contents of r into a struct and returns it. The given filename is used only for error messages. The type of struct to return is determined by the "kind" field in the YAML. If the given requireKind is non-empty, then we'll also validate that the "kind" of the YAML file matches requireKind, and return error if not. This also calls Validate() on the returned struct and returns error if invalid.

func DecodeValidateUpgrade

func DecodeValidateUpgrade(ctx context.Context, r io.Reader, filename, requireKind string) (model.ValidatorUpgrader, error)

DecodeValidateUpgrade parses the given YAML contents of r into a struct, then repeatedly calls Upgrade() and Validate() on it until it's the newest version, then returns it. requireKind has the same meaning as in Decode().

func LatestSupportedAPIVersion added in v0.6.0

func LatestSupportedAPIVersion(isReleaseBuild bool) string

LatestSupportedAPIVersion is the most up-to-date API version. It's in the format "cli.abcxyz.dev/v1beta4".

isReleaseBuild is the value of version.IsReleaseBuild(), but for testing purposes we make it an argument rather than hardcoding.

Types

This section is empty.

Jump to

Keyboard shortcuts

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