model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterParser added in v0.1.2

func RegisterParser(svc Parser)

Types

type Alias

type Alias struct {
	Name        string       `json:"name" yaml:"name" msgpack:"name"`
	Description *string      `json:"description,omitempty" yaml:"description,omitempty" msgpack:"description,omitempty"`
	Type        TypeRef      `json:"type" yaml:"type" msgpack:"type"`
	Annotations []Annotation `json:"annotations,omitempty" yaml:"annotations,omitempty" msgpack:"annotations,omitempty"`
	// contains filtered or unexported fields
}

Alias types are used for cases when scalar types (like string) should be parsed our treated like a different data type in the generated code.

func (*Alias) Decode added in v0.1.2

func (o *Alias) Decode(decoder msgpack.Reader) error

func (*Alias) Encode added in v0.1.2

func (o *Alias) Encode(encoder msgpack.Writer) error

func (Alias) MarshalJSON

func (v Alias) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Alias) MarshalTinyJSON

func (v Alias) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Alias) Namespace

func (n *Alias) Namespace() string

func (*Alias) UnmarshalJSON

func (v *Alias) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Alias) UnmarshalTinyJSON

func (v *Alias) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Annotation

type Annotation struct {
	Name      string     `json:"name" yaml:"name" msgpack:"name"`
	Arguments []Argument `json:"arguments,omitempty" yaml:"arguments,omitempty" msgpack:"arguments,omitempty"`
	// contains filtered or unexported fields
}

Annotations attach additional metadata to elements. These can be used in the code generation tool to implement custom functionality for your use case. Annotations have a name and zero or many arguments.

func (*Annotation) Decode added in v0.1.2

func (o *Annotation) Decode(decoder msgpack.Reader) error

func (*Annotation) Encode added in v0.1.2

func (o *Annotation) Encode(encoder msgpack.Writer) error

func (Annotation) MarshalJSON

func (v Annotation) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Annotation) MarshalTinyJSON

func (v Annotation) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Annotation) Namespace

func (n *Annotation) Namespace() string

func (*Annotation) UnmarshalJSON

func (v *Annotation) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Annotation) UnmarshalTinyJSON

func (v *Annotation) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Argument

type Argument struct {
	Name  string `json:"name" yaml:"name" msgpack:"name"`
	Value Value  `json:"value" yaml:"value" msgpack:"value"`
	// contains filtered or unexported fields
}

func (*Argument) Decode added in v0.1.2

func (o *Argument) Decode(decoder msgpack.Reader) error

func (*Argument) Encode added in v0.1.2

func (o *Argument) Encode(encoder msgpack.Writer) error

func (Argument) MarshalJSON

func (v Argument) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Argument) MarshalTinyJSON

func (v Argument) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Argument) Namespace

func (n *Argument) Namespace() string

func (*Argument) UnmarshalJSON

func (v *Argument) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Argument) UnmarshalTinyJSON

func (v *Argument) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Converter

type Converter struct {
	// contains filtered or unexported fields
}

func (*Converter) Convert

func (c *Converter) Convert(doc *ast.Document) (*Namespace, []error)

type Directive

type Directive struct {
	Name        string              `json:"name" yaml:"name" msgpack:"name"`
	Description *string             `json:"description,omitempty" yaml:"description,omitempty" msgpack:"description,omitempty"`
	Parameters  []Parameter         `json:"parameters,omitempty" yaml:"parameters,omitempty" msgpack:"parameters,omitempty"`
	Locations   []DirectiveLocation `json:"locations" yaml:"locations" msgpack:"locations"`
	Require     []DirectiveRequire  `json:"require" yaml:"require" msgpack:"require"`
	// contains filtered or unexported fields
}

Directives are used to ensure that an annotation's arguments match an expected format.

func (*Directive) Decode added in v0.1.2

func (o *Directive) Decode(decoder msgpack.Reader) error

func (*Directive) Encode added in v0.1.2

func (o *Directive) Encode(encoder msgpack.Writer) error

func (Directive) MarshalJSON

func (v Directive) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Directive) MarshalTinyJSON

func (v Directive) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Directive) Namespace

func (n *Directive) Namespace() string

func (*Directive) UnmarshalJSON

func (v *Directive) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Directive) UnmarshalTinyJSON

func (v *Directive) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type DirectiveLocation

type DirectiveLocation int32
const (
	DirectiveLocationNamespace DirectiveLocation = 0
	DirectiveLocationAlias     DirectiveLocation = 1
	DirectiveLocationUnion     DirectiveLocation = 2
	DirectiveLocationEnum      DirectiveLocation = 3
	DirectiveLocationEnumValue DirectiveLocation = 4
	DirectiveLocationType      DirectiveLocation = 5
	DirectiveLocationField     DirectiveLocation = 6
	DirectiveLocationInterface DirectiveLocation = 7
	DirectiveLocationOperation DirectiveLocation = 8
	DirectiveLocationParameter DirectiveLocation = 9
)

func (*DirectiveLocation) FromString

func (e *DirectiveLocation) FromString(str string) (ok bool)

func (DirectiveLocation) MarshalJSON

func (e DirectiveLocation) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (DirectiveLocation) String

func (e DirectiveLocation) String() string

func (DirectiveLocation) Type

func (e DirectiveLocation) Type() string

func (*DirectiveLocation) UnmarshalJSON

func (e *DirectiveLocation) UnmarshalJSON(b []byte) error

UnmarshalJSON unmashals a quoted json string to the enum value

type DirectiveRequire

type DirectiveRequire struct {
	Directive string              `json:"directive" yaml:"directive" msgpack:"directive"`
	Locations []DirectiveLocation `json:"locations" yaml:"locations" msgpack:"locations"`
	// contains filtered or unexported fields
}

func (*DirectiveRequire) Decode added in v0.1.2

func (o *DirectiveRequire) Decode(decoder msgpack.Reader) error

func (*DirectiveRequire) Encode added in v0.1.2

func (o *DirectiveRequire) Encode(encoder msgpack.Writer) error

func (DirectiveRequire) MarshalJSON

func (v DirectiveRequire) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (DirectiveRequire) MarshalTinyJSON

func (v DirectiveRequire) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*DirectiveRequire) Namespace

func (n *DirectiveRequire) Namespace() string

func (*DirectiveRequire) UnmarshalJSON

func (v *DirectiveRequire) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*DirectiveRequire) UnmarshalTinyJSON

func (v *DirectiveRequire) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Enum

type Enum struct {
	Name        string       `json:"name" yaml:"name" msgpack:"name"`
	Description *string      `json:"description,omitempty" yaml:"description,omitempty" msgpack:"description,omitempty"`
	Values      []EnumValue  `json:"values" yaml:"values" msgpack:"values"`
	Annotations []Annotation `json:"annotations,omitempty" yaml:"annotations,omitempty" msgpack:"annotations,omitempty"`
	// contains filtered or unexported fields
}

Enumerations (or enums) are a type that is constrained to a finite set of allowed values.

func (*Enum) Decode added in v0.1.2

func (o *Enum) Decode(decoder msgpack.Reader) error

func (*Enum) Encode added in v0.1.2

func (o *Enum) Encode(encoder msgpack.Writer) error

func (Enum) MarshalJSON

func (v Enum) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Enum) MarshalTinyJSON

func (v Enum) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Enum) Namespace

func (n *Enum) Namespace() string

func (*Enum) UnmarshalJSON

func (v *Enum) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Enum) UnmarshalTinyJSON

func (v *Enum) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type EnumValue

type EnumValue struct {
	Name        string       `json:"name" yaml:"name" msgpack:"name"`
	Description *string      `json:"description,omitempty" yaml:"description,omitempty" msgpack:"description,omitempty"`
	Index       uint64       `json:"index" yaml:"index" msgpack:"index"`
	Display     *string      `json:"display,omitempty" yaml:"display,omitempty" msgpack:"display,omitempty"`
	Annotations []Annotation `json:"annotations,omitempty" yaml:"annotations,omitempty" msgpack:"annotations,omitempty"`
	// contains filtered or unexported fields
}

func (*EnumValue) Decode added in v0.1.2

func (o *EnumValue) Decode(decoder msgpack.Reader) error

func (*EnumValue) Encode added in v0.1.2

func (o *EnumValue) Encode(encoder msgpack.Writer) error

func (EnumValue) MarshalJSON

func (v EnumValue) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (EnumValue) MarshalTinyJSON

func (v EnumValue) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*EnumValue) Namespace

func (n *EnumValue) Namespace() string

func (*EnumValue) UnmarshalJSON

func (v *EnumValue) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*EnumValue) UnmarshalTinyJSON

func (v *EnumValue) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Error added in v0.1.2

type Error struct {
	Message   string     `json:"message" yaml:"message" msgpack:"message"`
	Positions []uint32   `json:"positions" yaml:"positions" msgpack:"positions"`
	Locations []Location `json:"locations" yaml:"locations" msgpack:"locations"`
	// contains filtered or unexported fields
}

func (*Error) Decode added in v0.1.2

func (o *Error) Decode(decoder msgpack.Reader) error

func (*Error) Encode added in v0.1.2

func (o *Error) Encode(encoder msgpack.Writer) error

func (Error) MarshalJSON added in v0.1.2

func (v Error) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Error) MarshalTinyJSON added in v0.1.2

func (v Error) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Error) Namespace added in v0.1.2

func (n *Error) Namespace() string

func (*Error) UnmarshalJSON added in v0.1.2

func (v *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Error) UnmarshalTinyJSON added in v0.1.2

func (v *Error) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Field

type Field struct {
	Name         string       `json:"name" yaml:"name" msgpack:"name"`
	Description  *string      `json:"description,omitempty" yaml:"description,omitempty" msgpack:"description,omitempty"`
	Type         TypeRef      `json:"type" yaml:"type" msgpack:"type"`
	DefaultValue *Value       `json:"defaultValue,omitempty" yaml:"defaultValue,omitempty" msgpack:"defaultValue,omitempty"`
	Annotations  []Annotation `json:"annotations,omitempty" yaml:"annotations,omitempty" msgpack:"annotations,omitempty"`
	// contains filtered or unexported fields
}

func (*Field) Decode added in v0.1.2

func (o *Field) Decode(decoder msgpack.Reader) error

func (*Field) Encode added in v0.1.2

func (o *Field) Encode(encoder msgpack.Writer) error

func (Field) MarshalJSON

func (v Field) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Field) MarshalTinyJSON

func (v Field) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Field) Namespace

func (n *Field) Namespace() string

func (*Field) UnmarshalJSON

func (v *Field) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Field) UnmarshalTinyJSON

func (v *Field) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Import

type Import struct {
	Description *string      `json:"description,omitempty" yaml:"description,omitempty" msgpack:"description,omitempty"`
	All         bool         `json:"all" yaml:"all" msgpack:"all"`
	Names       []ImportRef  `json:"names,omitempty" yaml:"names,omitempty" msgpack:"names,omitempty"`
	From        string       `json:"from" yaml:"from" msgpack:"from"`
	Annotations []Annotation `json:"annotations,omitempty" yaml:"annotations,omitempty" msgpack:"annotations,omitempty"`
	// contains filtered or unexported fields
}

Apex can integrate external definitions using the import keyword.

func (*Import) Decode added in v0.1.2

func (o *Import) Decode(decoder msgpack.Reader) error

func (*Import) Encode added in v0.1.2

func (o *Import) Encode(encoder msgpack.Writer) error

func (Import) MarshalJSON

func (v Import) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Import) MarshalTinyJSON

func (v Import) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Import) Namespace

func (n *Import) Namespace() string

func (*Import) UnmarshalJSON

func (v *Import) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Import) UnmarshalTinyJSON

func (v *Import) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type ImportRef

type ImportRef struct {
	Name string  `json:"name" yaml:"name" msgpack:"name"`
	As   *string `json:"as,omitempty" yaml:"as,omitempty" msgpack:"as,omitempty"`
	// contains filtered or unexported fields
}

func (*ImportRef) Decode added in v0.1.2

func (o *ImportRef) Decode(decoder msgpack.Reader) error

func (*ImportRef) Encode added in v0.1.2

func (o *ImportRef) Encode(encoder msgpack.Writer) error

func (ImportRef) MarshalJSON

func (v ImportRef) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (ImportRef) MarshalTinyJSON

func (v ImportRef) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*ImportRef) Namespace

func (n *ImportRef) Namespace() string

func (*ImportRef) UnmarshalJSON

func (v *ImportRef) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*ImportRef) UnmarshalTinyJSON

func (v *ImportRef) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Interface

type Interface struct {
	Name        string       `json:"name" yaml:"name" msgpack:"name"`
	Description *string      `json:"description,omitempty" yaml:"description,omitempty" msgpack:"description,omitempty"`
	Operations  []Operation  `json:"operations" yaml:"operations" msgpack:"operations"`
	Annotations []Annotation `json:"annotations,omitempty" yaml:"annotations,omitempty" msgpack:"annotations,omitempty"`
	// contains filtered or unexported fields
}

Interfaces are conceptual groups of operations that allow the developer to divide communication into multiple components. Typically, interfaces are named according to their purpose.

func (*Interface) Decode added in v0.1.2

func (o *Interface) Decode(decoder msgpack.Reader) error

func (*Interface) Encode added in v0.1.2

func (o *Interface) Encode(encoder msgpack.Writer) error

func (Interface) MarshalJSON

func (v Interface) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Interface) MarshalTinyJSON

func (v Interface) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Interface) Namespace

func (n *Interface) Namespace() string

func (*Interface) UnmarshalJSON

func (v *Interface) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Interface) UnmarshalTinyJSON

func (v *Interface) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Kind

type Kind int32
const (
	KindType      Kind = 1
	KindFunc      Kind = 2
	KindInterface Kind = 3
	KindAlias     Kind = 4
	KindUnion     Kind = 5
	KindEnum      Kind = 6
)

func (*Kind) FromString

func (e *Kind) FromString(str string) (ok bool)

func (Kind) MarshalJSON

func (e Kind) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (Kind) String

func (e Kind) String() string

func (Kind) Type

func (e Kind) Type() string

func (*Kind) UnmarshalJSON

func (e *Kind) UnmarshalJSON(b []byte) error

UnmarshalJSON unmashals a quoted json string to the enum value

type List

type List struct {
	Type TypeRef `json:"type" yaml:"type" msgpack:"type"`
	// contains filtered or unexported fields
}

func (*List) Decode added in v0.1.2

func (o *List) Decode(decoder msgpack.Reader) error

func (*List) Encode added in v0.1.2

func (o *List) Encode(encoder msgpack.Writer) error

func (List) MarshalJSON

func (v List) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (List) MarshalTinyJSON

func (v List) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*List) Namespace

func (n *List) Namespace() string

func (*List) UnmarshalJSON

func (v *List) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*List) UnmarshalTinyJSON

func (v *List) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type ListValue

type ListValue struct {
	Values []Value `json:"values" yaml:"values" msgpack:"values"`
	// contains filtered or unexported fields
}

func (*ListValue) Decode added in v0.1.2

func (o *ListValue) Decode(decoder msgpack.Reader) error

func (*ListValue) Encode added in v0.1.2

func (o *ListValue) Encode(encoder msgpack.Writer) error

func (ListValue) MarshalJSON

func (v ListValue) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (ListValue) MarshalTinyJSON

func (v ListValue) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*ListValue) Namespace

func (n *ListValue) Namespace() string

func (*ListValue) UnmarshalJSON

func (v *ListValue) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*ListValue) UnmarshalTinyJSON

func (v *ListValue) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Location added in v0.1.2

type Location struct {
	Line   uint32 `json:"line" yaml:"line" msgpack:"line"`
	Column uint32 `json:"column" yaml:"column" msgpack:"column"`
	// contains filtered or unexported fields
}

func (*Location) Decode added in v0.1.2

func (o *Location) Decode(decoder msgpack.Reader) error

func (*Location) Encode added in v0.1.2

func (o *Location) Encode(encoder msgpack.Writer) error

func (Location) MarshalJSON added in v0.1.2

func (v Location) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Location) MarshalTinyJSON added in v0.1.2

func (v Location) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Location) Namespace added in v0.1.2

func (n *Location) Namespace() string

func (*Location) UnmarshalJSON added in v0.1.2

func (v *Location) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Location) UnmarshalTinyJSON added in v0.1.2

func (v *Location) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Map

type Map struct {
	KeyType   TypeRef `json:"keyType" yaml:"keyType" msgpack:"keyType"`
	ValueType TypeRef `json:"valueType" yaml:"valueType" msgpack:"valueType"`
	// contains filtered or unexported fields
}

func (*Map) Decode added in v0.1.2

func (o *Map) Decode(decoder msgpack.Reader) error

func (*Map) Encode added in v0.1.2

func (o *Map) Encode(encoder msgpack.Writer) error

func (Map) MarshalJSON

func (v Map) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Map) MarshalTinyJSON

func (v Map) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Map) Namespace

func (n *Map) Namespace() string

func (*Map) UnmarshalJSON

func (v *Map) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Map) UnmarshalTinyJSON

func (v *Map) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Named

type Named struct {
	Kind Kind   `json:"kind" yaml:"kind" msgpack:"kind"`
	Name string `json:"name" yaml:"name" msgpack:"name"`
	// contains filtered or unexported fields
}

func (*Named) Decode added in v0.1.2

func (o *Named) Decode(decoder msgpack.Reader) error

func (*Named) Encode added in v0.1.2

func (o *Named) Encode(encoder msgpack.Writer) error

func (Named) MarshalJSON

func (v Named) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Named) MarshalTinyJSON

func (v Named) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Named) Namespace

func (n *Named) Namespace() string

func (*Named) UnmarshalJSON

func (v *Named) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Named) UnmarshalTinyJSON

func (v *Named) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Namespace

type Namespace struct {
	Name        string       `json:"name" yaml:"name" msgpack:"name"`
	Description *string      `json:"description,omitempty" yaml:"description,omitempty" msgpack:"description,omitempty"`
	Annotations []Annotation `json:"annotations,omitempty" yaml:"annotations,omitempty" msgpack:"annotations,omitempty"`
	Imports     []Import     `json:"imports,omitempty" yaml:"imports,omitempty" msgpack:"imports,omitempty"`
	Directives  []Directive  `json:"directives,omitempty" yaml:"directives,omitempty" msgpack:"directives,omitempty"`
	Aliases     []Alias      `json:"aliases,omitempty" yaml:"aliases,omitempty" msgpack:"aliases,omitempty"`
	Functions   []Operation  `json:"functions,omitempty" yaml:"functions,omitempty" msgpack:"functions,omitempty"`
	Interfaces  []Interface  `json:"interfaces,omitempty" yaml:"interfaces,omitempty" msgpack:"interfaces,omitempty"`
	Types       []Type       `json:"types,omitempty" yaml:"types,omitempty" msgpack:"types,omitempty"`
	Unions      []Union      `json:"unions,omitempty" yaml:"unions,omitempty" msgpack:"unions,omitempty"`
	// contains filtered or unexported fields
}

Namespace encapsulates is used to identify and refer to elements contained in the Apex specification.

func Convert

func Convert(doc *ast.Document) (*Namespace, []error)

func (*Namespace) Decode added in v0.1.2

func (o *Namespace) Decode(decoder msgpack.Reader) error

func (*Namespace) Encode added in v0.1.2

func (o *Namespace) Encode(encoder msgpack.Writer) error

func (Namespace) MarshalJSON

func (v Namespace) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Namespace) MarshalTinyJSON

func (v Namespace) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Namespace) Namespace

func (n *Namespace) Namespace() string

func (*Namespace) UnmarshalJSON

func (v *Namespace) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Namespace) UnmarshalTinyJSON

func (v *Namespace) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type ObjectField

type ObjectField struct {
	Name  string `json:"name" yaml:"name" msgpack:"name"`
	Value Value  `json:"value" yaml:"value" msgpack:"value"`
	// contains filtered or unexported fields
}

func (*ObjectField) Decode added in v0.1.2

func (o *ObjectField) Decode(decoder msgpack.Reader) error

func (*ObjectField) Encode added in v0.1.2

func (o *ObjectField) Encode(encoder msgpack.Writer) error

func (ObjectField) MarshalJSON

func (v ObjectField) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (ObjectField) MarshalTinyJSON

func (v ObjectField) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*ObjectField) Namespace

func (n *ObjectField) Namespace() string

func (*ObjectField) UnmarshalJSON

func (v *ObjectField) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*ObjectField) UnmarshalTinyJSON

func (v *ObjectField) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type ObjectValue

type ObjectValue struct {
	Fields []ObjectField `json:"fields" yaml:"fields" msgpack:"fields"`
	// contains filtered or unexported fields
}

func (*ObjectValue) Decode added in v0.1.2

func (o *ObjectValue) Decode(decoder msgpack.Reader) error

func (*ObjectValue) Encode added in v0.1.2

func (o *ObjectValue) Encode(encoder msgpack.Writer) error

func (ObjectValue) MarshalJSON

func (v ObjectValue) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (ObjectValue) MarshalTinyJSON

func (v ObjectValue) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*ObjectValue) Namespace

func (n *ObjectValue) Namespace() string

func (*ObjectValue) UnmarshalJSON

func (v *ObjectValue) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*ObjectValue) UnmarshalTinyJSON

func (v *ObjectValue) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Operation

type Operation struct {
	Name        string       `json:"name" yaml:"name" msgpack:"name"`
	Description *string      `json:"description,omitempty" yaml:"description,omitempty" msgpack:"description,omitempty"`
	Parameters  []Parameter  `json:"parameters,omitempty" yaml:"parameters,omitempty" msgpack:"parameters,omitempty"`
	Unary       *Parameter   `json:"unary,omitempty" yaml:"unary,omitempty" msgpack:"unary,omitempty"`
	Returns     *TypeRef     `json:"returns,omitempty" yaml:"returns,omitempty" msgpack:"returns,omitempty"`
	Annotations []Annotation `json:"annotations,omitempty" yaml:"annotations,omitempty" msgpack:"annotations,omitempty"`
	// contains filtered or unexported fields
}

func (*Operation) Decode added in v0.1.2

func (o *Operation) Decode(decoder msgpack.Reader) error

func (*Operation) Encode added in v0.1.2

func (o *Operation) Encode(encoder msgpack.Writer) error

func (Operation) MarshalJSON

func (v Operation) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Operation) MarshalTinyJSON

func (v Operation) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Operation) Namespace

func (n *Operation) Namespace() string

func (*Operation) UnmarshalJSON

func (v *Operation) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Operation) UnmarshalTinyJSON

func (v *Operation) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Optional

type Optional struct {
	Type TypeRef `json:"type" yaml:"type" msgpack:"type"`
	// contains filtered or unexported fields
}

func (*Optional) Decode added in v0.1.2

func (o *Optional) Decode(decoder msgpack.Reader) error

func (*Optional) Encode added in v0.1.2

func (o *Optional) Encode(encoder msgpack.Writer) error

func (Optional) MarshalJSON

func (v Optional) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Optional) MarshalTinyJSON

func (v Optional) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Optional) Namespace

func (n *Optional) Namespace() string

func (*Optional) UnmarshalJSON

func (v *Optional) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Optional) UnmarshalTinyJSON

func (v *Optional) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Parameter

type Parameter struct {
	Name         string       `json:"name" yaml:"name" msgpack:"name"`
	Description  *string      `json:"description,omitempty" yaml:"description,omitempty" msgpack:"description,omitempty"`
	Type         TypeRef      `json:"type" yaml:"type" msgpack:"type"`
	DefaultValue *Value       `json:"defaultValue,omitempty" yaml:"defaultValue,omitempty" msgpack:"defaultValue,omitempty"`
	Annotations  []Annotation `json:"annotations,omitempty" yaml:"annotations,omitempty" msgpack:"annotations,omitempty"`
	// contains filtered or unexported fields
}

func (*Parameter) Decode added in v0.1.2

func (o *Parameter) Decode(decoder msgpack.Reader) error

func (*Parameter) Encode added in v0.1.2

func (o *Parameter) Encode(encoder msgpack.Writer) error

func (Parameter) MarshalJSON

func (v Parameter) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Parameter) MarshalTinyJSON

func (v Parameter) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Parameter) Namespace

func (n *Parameter) Namespace() string

func (*Parameter) UnmarshalJSON

func (v *Parameter) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Parameter) UnmarshalTinyJSON

func (v *Parameter) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Parser added in v0.1.2

type Parser interface {
	Parse(ctx context.Context, source string) (*ParserResult, error)
}

func NewParser added in v0.1.2

func NewParser(resolver Resolver) Parser

type ParserResult added in v0.1.2

type ParserResult struct {
	Namespace *Namespace `json:"namespace,omitempty" yaml:"namespace,omitempty" msgpack:"namespace,omitempty"`
	Errors    []Error    `json:"errors,omitempty" yaml:"errors,omitempty" msgpack:"errors,omitempty"`
	// contains filtered or unexported fields
}

func (*ParserResult) Decode added in v0.1.2

func (o *ParserResult) Decode(decoder msgpack.Reader) error

func (*ParserResult) Encode added in v0.1.2

func (o *ParserResult) Encode(encoder msgpack.Writer) error

func (ParserResult) MarshalJSON added in v0.1.2

func (v ParserResult) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (ParserResult) MarshalTinyJSON added in v0.1.2

func (v ParserResult) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*ParserResult) Namespace added in v0.1.2

func (n *ParserResult) Namespace() string

func (*ParserResult) UnmarshalJSON added in v0.1.2

func (v *ParserResult) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*ParserResult) UnmarshalTinyJSON added in v0.1.2

func (v *ParserResult) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Reference

type Reference struct {
	Name string `json:"name" yaml:"name" msgpack:"name"`
	// contains filtered or unexported fields
}

func (*Reference) Decode added in v0.1.2

func (o *Reference) Decode(decoder msgpack.Reader) error

func (*Reference) Encode added in v0.1.2

func (o *Reference) Encode(encoder msgpack.Writer) error

func (Reference) MarshalJSON

func (v Reference) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Reference) MarshalTinyJSON

func (v Reference) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Reference) Namespace

func (n *Reference) Namespace() string

func (*Reference) UnmarshalJSON

func (v *Reference) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Reference) UnmarshalTinyJSON

func (v *Reference) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Resolver added in v0.1.2

type Resolver interface {
	Resolve(ctx context.Context, location string, from string) (string, error)
}

type ResolverImpl added in v0.1.2

type ResolverImpl struct {
	// contains filtered or unexported fields
}

func NewResolver added in v0.1.2

func NewResolver(binding ...string) *ResolverImpl

func (*ResolverImpl) Resolve added in v0.1.2

func (h *ResolverImpl) Resolve(ctx context.Context, location string, from string) (string, error)

type Scalar

type Scalar int32
const (
	ScalarString   Scalar = 1
	ScalarBool     Scalar = 2
	ScalarI8       Scalar = 3
	ScalarI16      Scalar = 4
	ScalarI32      Scalar = 5
	ScalarI64      Scalar = 6
	ScalarU8       Scalar = 7
	ScalarU16      Scalar = 8
	ScalarU32      Scalar = 9
	ScalarU64      Scalar = 10
	ScalarF32      Scalar = 11
	ScalarF64      Scalar = 12
	ScalarBytes    Scalar = 13
	ScalarDatetime Scalar = 14
	ScalarAny      Scalar = 15
	ScalarRaw      Scalar = 16
)

func (*Scalar) FromString

func (e *Scalar) FromString(str string) (ok bool)

func (Scalar) MarshalJSON

func (e Scalar) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (Scalar) String

func (e Scalar) String() string

func (Scalar) Type

func (e Scalar) Type() string

func (*Scalar) UnmarshalJSON

func (e *Scalar) UnmarshalJSON(b []byte) error

UnmarshalJSON unmashals a quoted json string to the enum value

type Stream

type Stream struct {
	Type TypeRef `json:"type" yaml:"type" msgpack:"type"`
	// contains filtered or unexported fields
}

func (*Stream) Decode added in v0.1.2

func (o *Stream) Decode(decoder msgpack.Reader) error

func (*Stream) Encode added in v0.1.2

func (o *Stream) Encode(encoder msgpack.Writer) error

func (Stream) MarshalJSON

func (v Stream) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Stream) MarshalTinyJSON

func (v Stream) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Stream) Namespace

func (n *Stream) Namespace() string

func (*Stream) UnmarshalJSON

func (v *Stream) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Stream) UnmarshalTinyJSON

func (v *Stream) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Type

type Type struct {
	Name        string       `json:"name" yaml:"name" msgpack:"name"`
	Description *string      `json:"description,omitempty" yaml:"description,omitempty" msgpack:"description,omitempty"`
	Fields      []Field      `json:"fields" yaml:"fields" msgpack:"fields"`
	Annotations []Annotation `json:"annotations,omitempty" yaml:"annotations,omitempty" msgpack:"annotations,omitempty"`
	// contains filtered or unexported fields
}

Types are the most basic component of an Apex specification. They represent data structures with fields. Types are defined in a language-agnostic way. This means that complex features like nested structures, inheritance, and generics/templates are omitted by design.

func (*Type) Decode added in v0.1.2

func (o *Type) Decode(decoder msgpack.Reader) error

func (*Type) Encode added in v0.1.2

func (o *Type) Encode(encoder msgpack.Writer) error

func (Type) MarshalJSON

func (v Type) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Type) MarshalTinyJSON

func (v Type) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Type) Namespace

func (n *Type) Namespace() string

func (*Type) UnmarshalJSON

func (v *Type) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Type) UnmarshalTinyJSON

func (v *Type) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type TypeRef

type TypeRef struct {
	Scalar   *Scalar   `json:"Scalar,omitempty" yaml:"Scalar,omitempty" msgpack:"Scalar,omitempty"`
	Named    *Named    `json:"Named,omitempty" yaml:"Named,omitempty" msgpack:"Named,omitempty"`
	List     *List     `json:"List,omitempty" yaml:"List,omitempty" msgpack:"List,omitempty"`
	Map      *Map      `json:"Map,omitempty" yaml:"Map,omitempty" msgpack:"Map,omitempty"`
	Stream   *Stream   `json:"Stream,omitempty" yaml:"Stream,omitempty" msgpack:"Stream,omitempty"`
	Optional *Optional `json:"Optional,omitempty" yaml:"Optional,omitempty" msgpack:"Optional,omitempty"`
}

func (*TypeRef) Decode added in v0.1.2

func (o *TypeRef) Decode(decoder msgpack.Reader) error

func (*TypeRef) Encode added in v0.1.2

func (o *TypeRef) Encode(encoder msgpack.Writer) error

func (TypeRef) MarshalJSON

func (v TypeRef) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (TypeRef) MarshalTinyJSON

func (v TypeRef) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*TypeRef) UnmarshalJSON

func (v *TypeRef) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*TypeRef) UnmarshalTinyJSON

func (v *TypeRef) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Union

type Union struct {
	Name        string       `json:"name" yaml:"name" msgpack:"name"`
	Description *string      `json:"description,omitempty" yaml:"description,omitempty" msgpack:"description,omitempty"`
	Types       []TypeRef    `json:"types" yaml:"types" msgpack:"types"`
	Annotations []Annotation `json:"annotations,omitempty" yaml:"annotations,omitempty" msgpack:"annotations,omitempty"`
	// contains filtered or unexported fields
}

Unions types denote that a type can have one of several representations.

func (*Union) Decode added in v0.1.2

func (o *Union) Decode(decoder msgpack.Reader) error

func (*Union) Encode added in v0.1.2

func (o *Union) Encode(encoder msgpack.Writer) error

func (Union) MarshalJSON

func (v Union) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Union) MarshalTinyJSON

func (v Union) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Union) Namespace

func (n *Union) Namespace() string

func (*Union) UnmarshalJSON

func (v *Union) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Union) UnmarshalTinyJSON

func (v *Union) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Value

type Value struct {
	Bool        *bool        `json:"bool,omitempty" yaml:"bool,omitempty" msgpack:"bool,omitempty"`
	String      *string      `json:"string,omitempty" yaml:"string,omitempty" msgpack:"string,omitempty"`
	I64         *int64       `json:"i64,omitempty" yaml:"i64,omitempty" msgpack:"i64,omitempty"`
	F64         *float64     `json:"f64,omitempty" yaml:"f64,omitempty" msgpack:"f64,omitempty"`
	Reference   *Reference   `json:"Reference,omitempty" yaml:"Reference,omitempty" msgpack:"Reference,omitempty"`
	ListValue   *ListValue   `json:"ListValue,omitempty" yaml:"ListValue,omitempty" msgpack:"ListValue,omitempty"`
	ObjectValue *ObjectValue `json:"ObjectValue,omitempty" yaml:"ObjectValue,omitempty" msgpack:"ObjectValue,omitempty"`
}

func (*Value) Decode added in v0.1.2

func (o *Value) Decode(decoder msgpack.Reader) error

func (*Value) Encode added in v0.1.2

func (o *Value) Encode(encoder msgpack.Writer) error

func (Value) MarshalJSON

func (v Value) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Value) MarshalTinyJSON

func (v Value) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Value) UnmarshalJSON

func (v *Value) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Value) UnmarshalTinyJSON

func (v *Value) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

Jump to

Keyboard shortcuts

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