schema

package
v0.0.0-...-e142383 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2017 License: GPL-2.0 Imports: 5 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Backends = make(map[string]Backend)
)

Functions

func MakeGrammar

func MakeGrammar() *Grammar

func Register

func Register(name string, backend Backend)

Types

type ArrayType

type ArrayType struct {
	SubType Type
	Count   uint64
}

func (*ArrayType) Resolve

func (at *ArrayType) Resolve(s *Schema) error

type Backend

type Backend interface {
	Generate(*Schema) (string, error)
	Flags() *flag.FlagSet
	GeneratedFilename(string) string
}

type BoolType

type BoolType struct {
}

type ByteType

type ByteType struct {
}

type DeferType

type DeferType struct {
	Defer    string
	Resolved Type
}

func (*DeferType) Resolve

func (d *DeferType) Resolve(s *Schema) error

type Field

type Field struct {
	Name string
	Tag  string
	Type Type
}

type FloatType

type FloatType struct {
	Bits int
}

type IntType

type IntType struct {
	Bits   int
	Signed bool
	VarInt bool
}

type PointerType

type PointerType struct {
	SubType Type
}

func (*PointerType) Resolve

func (p *PointerType) Resolve(s *Schema) error

type ResolveError

type ResolveError struct {
	Defer string
}

func (ResolveError) Error

func (r ResolveError) Error() string

type ResolveType

type ResolveType interface {
	Resolve(s *Schema) error
}

type Schema

type Schema struct {
	Structs []*Struct
}

func ParseSchema

func ParseSchema(rs io.ReadSeeker) (*Schema, error)

func (*Schema) ResolveAll

func (s *Schema) ResolveAll() error

type SliceType

type SliceType struct {
	SubType Type
}

func (*SliceType) Resolve

func (st *SliceType) Resolve(s *Schema) error

type StringType

type StringType struct {
}

type Struct

type Struct struct {
	Name   string
	Fields []*Field
	Framed bool
}

type StructType

type StructType struct {
	Struct string
}

type TimeType

type TimeType struct {
}

type Type

type Type interface{}

type UnionType

type UnionType struct {
	Types     []Type
	Interface string
}

func (*UnionType) Resolve

func (u *UnionType) Resolve(s *Schema) error

Jump to

Keyboard shortcuts

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