schema

package
v0.19.992 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: AGPL-3.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SchemaMapping = map[string]func() (*jsonschema.Schema, error){

	"action":              ActionConfigSchema,
	"break-glass":         BreakGlassConfigSchema,
	"container-image":     ContainerImageConfigSchema,
	"docker-build":        DockerBuildConfigSchema,
	"helm":                HelmConfigSchema,
	"input":               InputSchema,
	"input-group":         InputGroupSchema,
	"inputs":              InputsConfigSchema,
	"install":             InstallSchema,
	"installer":           InstallerConfigSchema,
	"kubernetes-manifest": KubernetesManifestConfigSchema,
	"metadata":            MetadataConfigSchema,
	"permissions":         PermissionsConfigSchema,
	"policy":              PolicyConfigSchema,
	"policies":            PoliciesConfigSchema,
	"runner":              RunnerConfigSchema,
	"sandbox":             SandboxConfigSchema,
	"secret":              SecretConfigSchema,
	"secrets":             SecretsConfigSchema,
	"stack":               StackConfigSchema,
	"terraform":           TerraformModuleConfigSchema,
}

Functions

func ActionConfigSchema

func ActionConfigSchema() (*jsonschema.Schema, error)

func AppConfigSchema

func AppConfigSchema() (*jsonschema.Schema, error)

func BreakGlassConfigSchema

func BreakGlassConfigSchema() (*jsonschema.Schema, error)

func ContainerImageConfigSchema

func ContainerImageConfigSchema() (*jsonschema.Schema, error)

func DockerBuildConfigSchema

func DockerBuildConfigSchema() (*jsonschema.Schema, error)

func FetchRemoteSchema

func FetchRemoteSchema(ctx context.Context, apiURL, schemaType string) (*jsonschema.Schema, error)

FetchRemoteSchema fetches a schema from the API

func GetSchemaTypes

func GetSchemaTypes() []string

GetSchemaTypes returns all valid schema type names

func HelmConfigSchema

func HelmConfigSchema() (*jsonschema.Schema, error)

func InputGroupSchema

func InputGroupSchema() (*jsonschema.Schema, error)

func InputSchema

func InputSchema() (*jsonschema.Schema, error)

func InputsConfigSchema

func InputsConfigSchema() (*jsonschema.Schema, error)

func InstallSchema

func InstallSchema() (*jsonschema.Schema, error)

func InstallerConfigSchema

func InstallerConfigSchema() (*jsonschema.Schema, error)

func IsValidSchemaType

func IsValidSchemaType(typ string) bool

IsValidSchemaType checks if a schema type is valid

func KubernetesManifestConfigSchema

func KubernetesManifestConfigSchema() (*jsonschema.Schema, error)

func LookupSchemaType

func LookupSchemaType(typ string) (*jsonschema.Schema, error)

func MetadataConfigSchema

func MetadataConfigSchema() (*jsonschema.Schema, error)

func PermissionsConfigSchema

func PermissionsConfigSchema() (*jsonschema.Schema, error)

func PoliciesConfigSchema

func PoliciesConfigSchema() (*jsonschema.Schema, error)

func PolicyConfigSchema

func PolicyConfigSchema() (*jsonschema.Schema, error)

func RunnerConfigSchema

func RunnerConfigSchema() (*jsonschema.Schema, error)

func SandboxConfigSchema

func SandboxConfigSchema() (*jsonschema.Schema, error)

func SecretConfigSchema

func SecretConfigSchema() (*jsonschema.Schema, error)

func SecretsConfigSchema

func SecretsConfigSchema() (*jsonschema.Schema, error)

func StackConfigSchema

func StackConfigSchema() (*jsonschema.Schema, error)

func TerraformModuleConfigSchema

func TerraformModuleConfigSchema() (*jsonschema.Schema, error)

func Validate

func Validate(ctx context.Context, obj *config.AppConfig) ([]gojsonschema.ResultError, error)

func ValidateJSONSchemaExtend

func ValidateJSONSchemaExtend(structVal interface{}) error

ValidateJSONSchemaExtend checks that a struct and all its nested struct fields implement JSONSchemaExtend before being passed to reflection. This ensures proper schema generation with custom extensions.

Types

type SchemaDiff

type SchemaDiff struct {
	SchemaType     string
	MissingLocally []string // Properties in remote but not in local
	MissingRemote  []string // Properties in local but not in remote (not an issue for validation)
	TypeMismatches []TypeMismatch
}

SchemaDiff represents differences between local and remote schemas

func CheckSchemaCompatibility

func CheckSchemaCompatibility(ctx context.Context, apiURL, schemaType string) (*SchemaDiff, error)

CheckSchemaCompatibility fetches the remote schema and compares it with the local schema Returns a diff if there are meaningful differences, nil otherwise

func CompareSchemas

func CompareSchemas(local, remote *jsonschema.Schema) *SchemaDiff

CompareSchemas compares a local schema against a remote schema and returns differences

func (*SchemaDiff) HasMeaningfulDiff

func (d *SchemaDiff) HasMeaningfulDiff() bool

HasMeaningfulDiff returns true if there are differences that would cause validation failures We only care about properties missing locally (remote has new fields the CLI doesn't know about)

func (*SchemaDiff) String

func (d *SchemaDiff) String() string

type TypeMismatch

type TypeMismatch struct {
	Property   string
	LocalType  string
	RemoteType string
}

TypeMismatch represents a type difference for a property

Jump to

Keyboard shortcuts

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