schema

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: Apache-2.0 Imports: 3 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SchemaToObjectSpec

func SchemaToObjectSpec(schema map[string]*Attribute) hcldec.ObjectSpec

Types

type Attribute

type Attribute struct {
	// Type is the type of the value and must be one of the ValueType values.
	//   TypeBool - bool
	//   TypeInt - int
	//   TypeFloat - float64
	//   TypeString - string
	//   TypeList - []interface{}
	Type ValueType

	// Elem represents the element type. THis may only be set for only set for TypeList.
	Elem *Attribute

	// is this atribute required
	Required bool
}

type ValueType

type ValueType int

ValueType is an enum of the type that can be represented by a schema.

const (
	TypeInvalid ValueType = iota
	TypeBool
	TypeInt
	TypeFloat
	TypeString
	TypeList
)

Jump to

Keyboard shortcuts

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