json2schema

package module
v0.0.0-...-cc6b723 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2017 License: MIT Imports: 4 Imported by: 0

README

json2schema

Documentation

Index

Constants

View Source
const (
	TypeArray       = "array"
	TypeObject      = "object"
	KindField       = "field"
	KindGroup       = "group"
	FieldTypeText   = "text"
	FieldTypeSelect = "select"
	FieldTypeOption = "option"
	VarRoot         = "root"
	VarArrayRoot    = "array_root"
)

Json to schema constants

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayGroupSchema

type ArrayGroupSchema interface {
	SetChildrenSchema(Schema) ArrayGroupSchema
}

ArrayGroupSchema is interface of array group schemas

type ObjectGroupSchema

type ObjectGroupSchema interface {
	AppendChild(...Schema) ObjectGroupSchema
}

ObjectGroupSchema is interface of object group schemas

type Schema

type Schema interface {
	ToMap() map[string]interface{}
}

Schema interface

func MakeSchema

func MakeSchema(jsonData interface{}) Schema

MakeSchema is base starter method

type SchemaFactory

type SchemaFactory interface {
	Make() Schema
}

SchemaFactory is factory

type TypeNeededSchema

type TypeNeededSchema interface {
	Type(string) nameNeededSchema
}

TypeNeededSchema is one of builder methods

func Kind

func Kind(kind string) TypeNeededSchema

Kind will run builder and set kind

type Validations

type Validations []string

Validations is list of validator conditions

Jump to

Keyboard shortcuts

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