Documentation ¶
Index ¶
- func SchemaFor(val interface{}) (string, error)
- func SchemaForType(t reflect.Type) (string, error)
- type ArrayType
- type DataType
- type EnumValue
- type ErrUnexpectedToken
- type ErrUnknownToken
- type MapType
- type NamedUserType
- type OptionalType
- type PrimitiveType
- type Scanner
- type SchemaType
- type SchemaTypeKind
- type StructField
- type StructType
- type Token
- type TokenKind
- type Type
- type TypeKind
- type UnionSubtype
- type UnionType
- type UserDefinedEnum
- type UserDefinedType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrUnexpectedToken ¶
type ErrUnexpectedToken struct {
// contains filtered or unexported fields
}
Returned when the lexer encounters an unexpected token
func (*ErrUnexpectedToken) Error ¶
func (e *ErrUnexpectedToken) Error() string
type ErrUnknownToken ¶
type ErrUnknownToken struct {
// contains filtered or unexported fields
}
Returned when the lexer encounters an unexpected character
func (*ErrUnknownToken) Error ¶
func (e *ErrUnknownToken) Error() string
type NamedUserType ¶
type NamedUserType struct {
// contains filtered or unexported fields
}
This has not been compared with the list of user-defined types and is not guaranteed to actually exist; the consumer of this type must perform this lookup itself.
func (*NamedUserType) Kind ¶
func (nut *NamedUserType) Kind() TypeKind
func (*NamedUserType) Name ¶
func (nut *NamedUserType) Name() string
type OptionalType ¶
type OptionalType struct {
// contains filtered or unexported fields
}
func (*OptionalType) Kind ¶
func (ot *OptionalType) Kind() TypeKind
func (*OptionalType) Subtype ¶
func (ot *OptionalType) Subtype() Type
type PrimitiveType ¶
type PrimitiveType struct {
// contains filtered or unexported fields
}
func (*PrimitiveType) Kind ¶
func (pt *PrimitiveType) Kind() TypeKind
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
A scanner for reading lexographic tokens from a BARE schema language document.
func NewScanner ¶
Creates a new BARE schema language scanner for the given reader.
type SchemaType ¶
type SchemaType interface {
Name() string
}
type SchemaTypeKind ¶
type SchemaTypeKind int
type StructField ¶
type StructField struct {
// contains filtered or unexported fields
}
func (*StructField) Name ¶
func (sf *StructField) Name() string
func (*StructField) Type ¶
func (sf *StructField) Type() Type
type StructType ¶
type StructType struct {
// contains filtered or unexported fields
}
func (*StructType) Fields ¶
func (st *StructType) Fields() []StructField
func (*StructType) Kind ¶
func (st *StructType) Kind() TypeKind
type TokenKind ¶
type TokenKind int
const ( TTYPE TokenKind = iota TENUM // NAME is used for name, user-type-name, and enum-value-name. // Distinguishing between these requires context. TNAME TINTEGER TUINT TU8 TU16 TU32 TU64 TINT TI8 TI16 TI32 TI64 TF32 TF64 TBOOL TSTRING TDATA TVOID TMAP TOPTIONAL // < TLANGLE // > TRANGLE // { TLBRACE // } TRBRACE // [ TLBRACKET // ] TRBRACKET // ( TLPAREN // ) TRPAREN // | TPIPE // = TEQUAL // : TCOLON )
type TypeKind ¶
type TypeKind int
const ( UINT TypeKind = iota U8 U16 U32 U64 INT I8 I16 I32 I64 F32 F64 Bool String Void // data Data // data<length> DataFixed // [len]type Array // []type Slice // optional<type> Optional // data<len> DataArray // data DataSlice // map[type]type Map // (type | type | ...) Union // { fields... } Struct // Named user type UserType )
type UnionSubtype ¶
type UnionSubtype struct {
// contains filtered or unexported fields
}
func (*UnionSubtype) Tag ¶
func (ust *UnionSubtype) Tag() uint64
func (*UnionSubtype) Type ¶
func (ust *UnionSubtype) Type() Type
type UnionType ¶
type UnionType struct {
// contains filtered or unexported fields
}
func (*UnionType) Types ¶
func (ut *UnionType) Types() []UnionSubtype
type UserDefinedEnum ¶
type UserDefinedEnum struct {
// contains filtered or unexported fields
}
func (*UserDefinedEnum) Kind ¶
func (ude *UserDefinedEnum) Kind() TypeKind
func (*UserDefinedEnum) Name ¶
func (ude *UserDefinedEnum) Name() string
func (*UserDefinedEnum) Values ¶
func (ude *UserDefinedEnum) Values() []EnumValue
type UserDefinedType ¶
type UserDefinedType struct {
// contains filtered or unexported fields
}
func (*UserDefinedType) Name ¶
func (udt *UserDefinedType) Name() string
func (*UserDefinedType) Type ¶
func (udt *UserDefinedType) Type() Type
Click to show internal directories.
Click to hide internal directories.