schema

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package schema provides the standard schema for the function-hcl DSL.

Index

Constants

View Source
const LanguageHCL = "hcl"

Variables

View Source
var StandardFunctions = stdFunctions()

Functions

func BasicK8sObjectConstraint

func BasicK8sObjectConstraint() schema.Object

BasicK8sObjectConstraint returns a constraint for a generic K8s object.

func DependentSchemaOrDefault

func DependentSchemaOrDefault(dyn DynamicLookup, bodyBlock *hclsyntax.Block) *schema.AttributeSchema

DependentSchemaOrDefault returns an available schema for a body attribute or a default.

func New

func New(dyn DynamicLookup) schema.Lookup

New returns a schema.Lookup instance.

func WithStatusOnly

func WithStatusOnly(aSchema *schema.AttributeSchema) *schema.AttributeSchema

WithStatusOnly returns an attribute schema that only has the `status` property if one is present. Otherwise, the schema is returned as-is.

func WithoutAPIVersionAndKind

func WithoutAPIVersionAndKind(aSchema *schema.AttributeSchema) *schema.AttributeSchema

WithoutAPIVersionAndKind returns an attribute schema that eliminates the `apiVersion` and `kind` properties, if present.

func WithoutStatus

func WithoutStatus(aSchema *schema.AttributeSchema) *schema.AttributeSchema

WithoutStatus returns an attribute schema that eliminates the `status` property if one is present.

Types

type CompositeSchemaLookup

type CompositeSchemaLookup interface {
	CompositeSchema() *schema.AttributeSchema
}

CompositeSchemaLookup is an optional interface that can be implemented by DynamicLookup to dynamically figure out the schema for the composite.

type DynamicLookup

type DynamicLookup interface {
	Schema(apiVersion, kind string) *schema.AttributeSchema
}

DynamicLookup provides a schema for the supplied API version and kind.

type LocalsAttributeLookup

type LocalsAttributeLookup interface {
	LocalSchema(name string) *schema.AttributeSchema
}

LocalsAttributeLookup is an optional interface that can be implemented by DynamicLookup to dynamically figure out schemas for local variables based on how they are assigned. (for example: foo = req.composite.metadata.name => foo is of type string)

Jump to

Keyboard shortcuts

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