schemas

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Coerce

func Coerce(val interface{}, schema *Schema) interface{}

func CoerceArray

func CoerceArray(arr []interface{}, schema *Schema) []interface{}

func CoerceObject

func CoerceObject(obj map[string]interface{}, schema *Schema) map[string]interface{}

func ResourceTypes

func ResourceTypes() []string

Types

type Schema

type Schema struct {
	Type       Type
	Properties map[string]*Schema
	Items      *Schema
}

A Schema correponds to a resource or a subtree of a resource. They may contain infinite loops.

func GetSchema

func GetSchema(resourceType string) *Schema

type Type

type Type int
const (
	Boolean Type = iota
	Integer
	Number
	String
	Array
	Object
)

Jump to

Keyboard shortcuts

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