jsonschema

package
v0.0.0-...-7b190fc Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Title            string           `yaml:"title,omitempty" json:"title,omitempty"`
	Description      string           `yaml:"description,omitempty" json:"description,omitempty"`
	Type             string           `yaml:"type,omitempty" json:"type,omitempty"` // string, number, integer, boolean, object, array, null
	Default          interface{}      `yaml:"default,omitempty" json:"default,omitempty"`
	Examples         []interface{}    `yaml:"examples,omitempty" json:"examples,omitempty"`
	Enum             []interface{}    `yaml:"enum,omitempty" json:"enum,omitempty"`
	MinLength        int32            `yaml:"minLength,omitempty" json:"minLength,omitempty"`
	MaxLength        int32            `yaml:"maxLength,omitempty" json:"maxLength,omitempty"`
	Pattern          string           `yaml:"pattern,omitempty" json:"pattern,omitempty"`
	Format           string           `yaml:"format,omitempty" json:"format,omitempty"`
	Minimum          int32            `yaml:"minimum,omitempty" json:"minimum,omitempty"`
	Maximum          int32            `yaml:"maximum,omitempty" json:"maximum,omitempty"`
	ExclusiveMinimum int32            `yaml:"exclusiveMinimum,omitempty" json:"exclusiveMinimum,omitempty"`
	ExclusiveMaximum int32            `yaml:"exclusiveMaximum,omitempty" json:"exclusiveMaximum,omitempty"`
	MultipleOf       int32            `yaml:"multipleOf,omitempty" json:"multipleOf,omitempty"`
	Items            *Node            `yaml:"items,omitempty" json:"items,omitempty"`
	AdditionalItems  bool             `yaml:"additionalItems,omitempty" json:"additionalItems,omitempty"`
	MinItems         int32            `yaml:"minItems,omitempty" json:"minItems,omitempty"`
	MaxItems         int32            `yaml:"maxItems,omitempty" json:"maxItems,omitempty"`
	UniqueItems      bool             `yaml:"uniqueItems,omitempty" json:"uniqueItems,omitempty"`
	Properties       map[string]*Node `yaml:"properties,omitempty" json:"properties,omitempty"`
	Required         []string         `yaml:"required,omitempty" json:"required,omitempty"`
	// contains filtered or unexported fields
}

func (*Node) ApplyDefaultsToArr

func (n *Node) ApplyDefaultsToArr(inp []interface{})

func (*Node) ApplyDefaultsToMSI

func (n *Node) ApplyDefaultsToMSI(inp map[string]interface{})

func (*Node) Compile

func (n *Node) Compile() (err error)

func (*Node) Scan

func (n *Node) Scan(value interface{}) error

Implement the sql.Scanner interface to take care of unmarshaling the serialized form (stored in the database) into the Go Node structure

func (*Node) ToProto

func (n *Node) ToProto() *terrariumpb.JSONSchema

func (*Node) Validate

func (n *Node) Validate(val interface{}) error

func (Node) Value

func (n Node) Value() (driver.Value, error)

Implement the driver.Valuer interface to serialize the Node struct

into a format suitable for storing in the database.

Jump to

Keyboard shortcuts

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