Documentation
¶
Overview ¶
Package schema provides the standard schema for the function-hcl DSL.
Index ¶
- Constants
- Variables
- func BasicK8sObjectConstraint() schema.Object
- func DependentSchemaOrDefault(dyn DynamicLookup, bodyBlock *hclsyntax.Block) *schema.AttributeSchema
- func New(dyn DynamicLookup) schema.Lookup
- func WithStatusOnly(aSchema *schema.AttributeSchema) *schema.AttributeSchema
- func WithoutAPIVersionAndKind(aSchema *schema.AttributeSchema) *schema.AttributeSchema
- func WithoutStatus(aSchema *schema.AttributeSchema) *schema.AttributeSchema
- type CompositeSchemaLookup
- type DynamicLookup
- type LocalsAttributeLookup
Constants ¶
const LanguageHCL = "hcl"
Variables ¶
var StandardFunctions = stdFunctions()
Functions ¶
func BasicK8sObjectConstraint ¶
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 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)