Documentation
¶
Index ¶
- Variables
- func ActionConfigSchema() (*jsonschema.Schema, error)
- func AppConfigSchema() (*jsonschema.Schema, error)
- func BreakGlassConfigSchema() (*jsonschema.Schema, error)
- func ContainerImageConfigSchema() (*jsonschema.Schema, error)
- func DockerBuildConfigSchema() (*jsonschema.Schema, error)
- func FetchRemoteSchema(ctx context.Context, apiURL, schemaType string) (*jsonschema.Schema, error)
- func GetSchemaTypes() []string
- func HelmConfigSchema() (*jsonschema.Schema, error)
- func InputGroupSchema() (*jsonschema.Schema, error)
- func InputSchema() (*jsonschema.Schema, error)
- func InputsConfigSchema() (*jsonschema.Schema, error)
- func InstallSchema() (*jsonschema.Schema, error)
- func InstallerConfigSchema() (*jsonschema.Schema, error)
- func IsValidSchemaType(typ string) bool
- func KubernetesManifestConfigSchema() (*jsonschema.Schema, error)
- func LookupSchemaType(typ string) (*jsonschema.Schema, error)
- func MetadataConfigSchema() (*jsonschema.Schema, error)
- func PermissionsConfigSchema() (*jsonschema.Schema, error)
- func PoliciesConfigSchema() (*jsonschema.Schema, error)
- func PolicyConfigSchema() (*jsonschema.Schema, error)
- func RunnerConfigSchema() (*jsonschema.Schema, error)
- func SandboxConfigSchema() (*jsonschema.Schema, error)
- func SecretConfigSchema() (*jsonschema.Schema, error)
- func SecretsConfigSchema() (*jsonschema.Schema, error)
- func StackConfigSchema() (*jsonschema.Schema, error)
- func TerraformModuleConfigSchema() (*jsonschema.Schema, error)
- func Validate(ctx context.Context, obj *config.AppConfig) ([]gojsonschema.ResultError, error)
- func ValidateJSONSchemaExtend(structVal interface{}) error
- type SchemaDiff
- type TypeMismatch
Constants ¶
This section is empty.
Variables ¶
var SchemaMapping = map[string]func() (*jsonschema.Schema, error){ "action": ActionConfigSchema, "break-glass": BreakGlassConfigSchema, "container-image": ContainerImageConfigSchema, "docker-build": DockerBuildConfigSchema, "full": AppConfigSchema, "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 ¶
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 ¶
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 ¶
TypeMismatch represents a type difference for a property