schemadmt

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Type struct {
	Schema schema.TypedPrototype
}

Functions

func Compile added in v0.12.2

func Compile(ts *schema.TypeSystem, node *Schema) error

Compile transforms a schema in DMT form into a TypeSystem.

Note that this API is EXPERIMENTAL and will likely change. It is also unfinished and buggy.

Types

type AnyScalar

type AnyScalar struct {
	Bool   *bool
	String *string
	Bytes  *[]uint8
	Int    *int
	Float  *float64
}

type EnumRepresentation

type EnumRepresentation struct {
	EnumRepresentation_String *EnumRepresentation_String
	EnumRepresentation_Int    *EnumRepresentation_Int
}

type EnumRepresentation_Int

type EnumRepresentation_Int struct {
	Keys   []string
	Values map[string]int
}

type EnumRepresentation_String

type EnumRepresentation_String struct {
	Keys   []string
	Values map[string]string
}

type InlineDefn added in v0.12.2

type InlineDefn struct {
	TypeMap  *TypeMap
	TypeList *TypeList
}

type ListRepresentation

type ListRepresentation struct {
	ListRepresentation_List *ListRepresentation_List
}

type ListRepresentation_List

type ListRepresentation_List struct {
}

type List__FieldName

type List__FieldName []string

type List__TypeName

type List__TypeName []string

type MapRepresentation

type MapRepresentation struct {
	MapRepresentation_Map         *MapRepresentation_Map
	MapRepresentation_Stringpairs *MapRepresentation_Stringpairs
	MapRepresentation_Listpairs   *MapRepresentation_Listpairs
}

type MapRepresentation_Listpairs

type MapRepresentation_Listpairs struct {
}

type MapRepresentation_Map

type MapRepresentation_Map struct {
}

type MapRepresentation_Stringpairs

type MapRepresentation_Stringpairs struct {
	InnerDelim string
	EntryDelim string
}

type Map__EnumValue__Unit

type Map__EnumValue__Unit struct {
	Keys   []string
	Values map[string]Unit
}

type Map__FieldName__StructField

type Map__FieldName__StructField struct {
	Keys   []string
	Values map[string]StructField
}

type Map__FieldName__StructRepresentation_Map_FieldDetails

type Map__FieldName__StructRepresentation_Map_FieldDetails struct {
	Keys   []string
	Values map[string]StructRepresentation_Map_FieldDetails
}

type Map__String__TypeName

type Map__String__TypeName struct {
	Keys   []string
	Values map[string]string
}

type Map__TypeName__Int

type Map__TypeName__Int struct {
	Keys   []string
	Values map[string]int
}

type Schema

type Schema struct {
	Types SchemaMap
}

type SchemaMap

type SchemaMap struct {
	Keys   []string
	Values map[string]TypeDefn
}

type StructField

type StructField struct {
	Type     TypeTerm
	Optional bool
	Nullable bool
}

type StructRepresentation

type StructRepresentation struct {
	StructRepresentation_Map         *StructRepresentation_Map
	StructRepresentation_Tuple       *StructRepresentation_Tuple
	StructRepresentation_Stringpairs *StructRepresentation_Stringpairs
	StructRepresentation_Stringjoin  *StructRepresentation_Stringjoin
	StructRepresentation_Listpairs   *StructRepresentation_Listpairs
}

type StructRepresentation_Listpairs

type StructRepresentation_Listpairs struct {
}

type StructRepresentation_Map

type StructRepresentation_Map struct {
	Fields *Map__FieldName__StructRepresentation_Map_FieldDetails
}

type StructRepresentation_Map_FieldDetails

type StructRepresentation_Map_FieldDetails struct {
	Rename   *string
	Implicit *AnyScalar
}

type StructRepresentation_Stringjoin

type StructRepresentation_Stringjoin struct {
	Join       string
	FieldOrder *List__FieldName
}

type StructRepresentation_Stringpairs

type StructRepresentation_Stringpairs struct {
	InnerDelim string
	EntryDelim string
}

type StructRepresentation_Tuple

type StructRepresentation_Tuple struct {
	FieldOrder *List__FieldName
}

type TypeBool

type TypeBool struct {
}

type TypeBytes

type TypeBytes struct {
}

type TypeCopy

type TypeCopy struct {
	FromType string
}

type TypeDefn

type TypeDefn struct {
	TypeBool   *TypeBool
	TypeString *TypeString
	TypeBytes  *TypeBytes
	TypeInt    *TypeInt
	TypeFloat  *TypeFloat
	TypeMap    *TypeMap
	TypeList   *TypeList
	TypeLink   *TypeLink
	TypeUnion  *TypeUnion
	TypeStruct *TypeStruct
	TypeEnum   *TypeEnum
	TypeCopy   *TypeCopy
}

type TypeEnum

type TypeEnum struct {
	Members        Map__EnumValue__Unit
	Representation EnumRepresentation
}

type TypeFloat

type TypeFloat struct {
}

type TypeInt

type TypeInt struct {
}
type TypeLink struct {
	ExpectedType *string
}

type TypeList

type TypeList struct {
	ValueType      TypeTerm
	ValueNullable  bool
	Representation ListRepresentation
}

type TypeMap

type TypeMap struct {
	KeyType        string
	ValueType      TypeTerm
	ValueNullable  bool
	Representation MapRepresentation
}

type TypeString

type TypeString struct {
}

type TypeStruct

type TypeStruct struct {
	Fields         Map__FieldName__StructField
	Representation StructRepresentation
}

type TypeTerm added in v0.12.2

type TypeTerm struct {
	TypeName   *string
	InlineDefn *InlineDefn
}

type TypeUnion

type TypeUnion struct {
	Members        List__TypeName
	Representation UnionRepresentation
}

type UnionRepresentation

type UnionRepresentation struct {
	UnionRepresentation_Kinded       *UnionRepresentation_Kinded
	UnionRepresentation_Keyed        *UnionRepresentation_Keyed
	UnionRepresentation_Envelope     *UnionRepresentation_Envelope
	UnionRepresentation_Inline       *UnionRepresentation_Inline
	UnionRepresentation_StringPrefix *UnionRepresentation_StringPrefix
	UnionRepresentation_BytePrefix   *UnionRepresentation_BytePrefix
}

type UnionRepresentation_BytePrefix

type UnionRepresentation_BytePrefix struct {
	DiscriminantTable Map__TypeName__Int
}

type UnionRepresentation_Envelope

type UnionRepresentation_Envelope struct {
	DiscriminantKey   string
	ContentKey        string
	DiscriminantTable Map__String__TypeName
}

type UnionRepresentation_Inline

type UnionRepresentation_Inline struct {
	DiscriminantKey   string
	DiscriminantTable Map__String__TypeName
}

type UnionRepresentation_Keyed

type UnionRepresentation_Keyed struct {
	Keys   []string
	Values map[string]string
}

type UnionRepresentation_Kinded

type UnionRepresentation_Kinded struct {
	Keys   []string
	Values map[string]string
}

type UnionRepresentation_StringPrefix

type UnionRepresentation_StringPrefix struct {
	DiscriminantTable Map__String__TypeName
}

type Unit

type Unit struct {
}

Jump to

Keyboard shortcuts

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