schema

package
v5.4.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 3 Imported by: 32

Documentation

Overview

Package schema provides types used to define the plugin.ConnectionConfigSchema

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 {
	// name - this will be inferred by the schema map key
	Name string
	// 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 attribute 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