schema

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package schema embeds versioned JSON schemas for manifest, environment, and platform validation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvironmentsSchema

func GetEnvironmentsSchema(version string) ([]byte, error)

GetEnvironmentsSchema returns the environments schema for the given version. Version strings should follow the format "v1-alpha.2", "v1-beta.2", etc. The schema file must be named "environments.json" within the version directory.

func GetLatestManifestSchema

func GetLatestManifestSchema() ([]byte, error)

GetLatestManifestSchema returns the latest manifest schema ([]byte) by version order.

func GetLatestManifestVersion

func GetLatestManifestVersion() (string, error)

GetLatestManifestVersion returns the latest manifest schema version (string).

func GetManifestSchema

func GetManifestSchema(version string) ([]byte, error)

GetManifestSchema retrieves the JSON schema for validating manifests at a specific version. Version strings should follow the format "v1-alpha.2", "v1-beta.2", etc. The schema file must be named "manifest.json" within the version directory.

func GetManifestSchemas

func GetManifestSchemas() (map[string][]byte, error)

GetManifestSchemas returns a map of version string to manifest schema []byte. It skips the platform/ subdirectory.

func GetPlatformSchema added in v0.4.0

func GetPlatformSchema(version string) ([]byte, error)

GetPlatformSchema retrieves the JSON schema for validating platform configs at a specific version. Version strings should follow the format "v1-alpha.2", "v1-beta.2", etc. The schema file must be named "platform.json" within the platform/VERSION directory.

func GetValidManifestVersions

func GetValidManifestVersions() ([]string, error)

GetValidManifestVersions returns all supported manifest schema versions in ascending order.

Types

type SchemaType

type SchemaType string

SchemaType is the type of schema.

const (
	// SchemaTypeManifest is the type of schema for validating manifests.
	SchemaTypeManifest SchemaType = "manifest"
	// SchemaTypeEnvironments is the type of schema for validating environments.
	SchemaTypeEnvironments SchemaType = "environments"
	// SchemaTypePlatform is the type of schema for validating platform configs.
	SchemaTypePlatform SchemaType = "platform"
)

func (SchemaType) String

func (s SchemaType) String() string

String returns the string representation of the schema type.

Jump to

Keyboard shortcuts

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