ast

package
v1.3.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

	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 {
	NamePrv string
	Line    int
}

func (*AnyType) Decl

func (a *AnyType) Decl() string

func (*AnyType) Name

func (a *AnyType) Name() string

type ArrType

type ArrType struct {
	Elem DataType
	Line int
}

func (*ArrType) Decl

func (a *ArrType) Decl() string

func (*ArrType) Name

func (a *ArrType) Name() string

type BaseType

type BaseType struct {
	DataType string
	Line     int
}

func (*BaseType) Decl

func (b *BaseType) Decl() string

func (*BaseType) Name

func (b *BaseType) Name() string

type Call

type Call struct {
	Name       string
	Arg        DataType
	ArgValTag  string
	Ret        DataType
	RetValTag  string
	Async      bool
	Timeout    *time.Duration
	MaxArgSize *int64
	MaxRetSize *int64
	Line       int
}

func (*Call) NamePrv

func (c *Call) NamePrv() string

type DataType

type DataType interface {
	// Returns go variable declaration.
	Decl() string
	// Returns simple name.
	Name() string
}

type Enum

type Enum struct {
	Name   string
	Values []*EnumValue
	Line   int
}

type EnumType

type EnumType struct {
	NamePrv string
	Line    int
}

func (*EnumType) Decl

func (e *EnumType) Decl() string

func (*EnumType) Name

func (e *EnumType) Name() string

type EnumValue

type EnumValue struct {
	Name  string
	Value int
	Line  int
}

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
	Line int
}

type MapType

type MapType struct {
	Key   DataType
	Value DataType
	Line  int
}

func (*MapType) Decl

func (m *MapType) Decl() string

func (*MapType) Name

func (m *MapType) Name() string

type Service

type Service struct {
	Url     string
	Calls   []*Call
	Streams []*Stream
	Line    int
}

type Stream

type Stream struct {
	Name       string
	Arg        DataType
	ArgValTag  string
	Ret        DataType
	RetValTag  string
	MaxArgSize *int64
	MaxRetSize *int64
	Line       int
}

func (*Stream) NamePrv

func (s *Stream) NamePrv() string

type StructType

type StructType struct {
	NamePrv string
	Line    int
}

func (*StructType) Decl

func (s *StructType) Decl() string

func (*StructType) Name

func (s *StructType) Name() string

type Tree

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

type Type

type Type struct {
	Name   string
	Fields []*TypeField
	Line   int
}

type TypeField

type TypeField struct {
	Name     string
	DataType DataType
	ValTag   string
	Line     int
}

Jump to

Keyboard shortcuts

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