ast

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeByte     = "byte"
	TypeString   = "string"
	TypeTime     = "time"
	TypeDuration = "duration"

	TypeBool = "bool"

	TypeInt   = "int"
	TypeInt8  = "int8"
	TypeInt16 = "int16"
	TypeInt32 = "int32"
	TypeInt64 = "int64"

	TypeUInt   = "uint"
	TypeUInt8  = "uint8"
	TypeUInt16 = "uint16"
	TypeUInt32 = "uint32"
	TypeUInt64 = "uint64"

	TypeFloat32 = "float32"
	TypeFloat64 = "float64"
)

Variables

This section is empty.

Functions

func NewErr

func NewErr(line int, format string, args ...interface{}) error

Types

type AnyType

type AnyType struct {
	Name string
	lexer.Pos
}

func (*AnyType) Decl

func (a *AnyType) Decl() string

func (*AnyType) ID added in v1.6.0

func (a *AnyType) ID() string

type ArrType

type ArrType struct {
	Elem DataType
	lexer.Pos
}

func (*ArrType) Decl

func (a *ArrType) Decl() string

func (*ArrType) ID added in v1.6.0

func (a *ArrType) ID() string

type BaseType

type BaseType struct {
	DataType string
	lexer.Pos
}

func (*BaseType) Decl

func (b *BaseType) Decl() string

func (*BaseType) ID added in v1.6.0

func (b *BaseType) ID() string

type Call

type Call struct {
	Name       string
	Arg        DataType
	Ret        DataType
	Async      bool
	Timeout    *time.Duration
	MaxArgSize *int64
	MaxRetSize *int64
	Errors     []*Error
	lexer.Pos
}

func (*Call) Ident added in v1.6.0

func (c *Call) Ident() string

func (*Call) IdentPrv added in v1.6.0

func (c *Call) IdentPrv() string

type DataType

type DataType interface {
	// Returns go variable declaration.
	Decl() string
	// Returns identifier.
	ID() string
}

type Enum

type Enum struct {
	Name   string
	Values []*EnumValue
	lexer.Pos
}

func (Enum) Ident added in v1.6.0

func (e Enum) Ident() string

type EnumType

type EnumType struct {
	Name string
	lexer.Pos
}

func (*EnumType) Decl

func (e *EnumType) Decl() string

func (*EnumType) ID added in v1.6.0

func (e *EnumType) ID() string

type EnumValue

type EnumValue struct {
	Name  string
	Value int
	lexer.Pos
}

func (EnumValue) Ident added in v1.6.0

func (ev EnumValue) Ident() string

type Err

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

func (Err) Error

func (e Err) Error() string

type Error

type Error struct {
	Name string
	ID   int
	lexer.Pos
}

func (Error) Ident added in v1.6.0

func (e Error) Ident() string

type File added in v1.6.0

type File struct {
	Version *Version
	Srvc    *Service
	Types   []*Type
	Errs    []*Error
	Enums   []*Enum
}

type MapType

type MapType struct {
	Key   DataType
	Value DataType
	lexer.Pos
}

func (*MapType) Decl

func (m *MapType) Decl() string

func (*MapType) ID added in v1.6.0

func (m *MapType) ID() string

type Service

type Service struct {
	Calls   []*Call
	Streams []*Stream
	lexer.Pos
}

type Stream

type Stream struct {
	Name       string
	Arg        DataType
	Ret        DataType
	MaxArgSize *int64
	MaxRetSize *int64
	Errors     []*Error
	lexer.Pos
}

func (*Stream) Ident added in v1.6.0

func (s *Stream) Ident() string

func (*Stream) IdentPrv added in v1.6.0

func (s *Stream) IdentPrv() string

type StructType

type StructType struct {
	Name string
	lexer.Pos
}

func (*StructType) Decl

func (s *StructType) Decl() string

func (*StructType) ID added in v1.6.0

func (s *StructType) ID() string

type Type

type Type struct {
	Name   string
	Fields []*TypeField
	lexer.Pos
}

func (Type) Ident added in v1.6.0

func (t Type) Ident() string

type TypeField

type TypeField struct {
	Name      string
	DataType  DataType
	StructTag string
	lexer.Pos
}

func (TypeField) Ident added in v1.6.0

func (tf TypeField) Ident() string

type Version added in v1.6.0

type Version struct {
	Value int
	lexer.Pos
}

Jump to

Keyboard shortcuts

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