ast

package
v1.6.17 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 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
	// contains filtered or unexported fields
}

func NewAnyType added in v1.6.15

func NewAnyType(name string, pos lexer.Pos, pointer bool) *AnyType

func (*AnyType) Decl

func (a *AnyType) Decl() string

func (*AnyType) ID added in v1.6.0

func (a *AnyType) ID() string

func (AnyType) Pointer added in v1.6.15

func (d AnyType) Pointer() bool

func (AnyType) Pos added in v1.6.15

func (d AnyType) Pos() lexer.Pos

type ArrType

type ArrType struct {
	Elem DataType
	// contains filtered or unexported fields
}

func NewArrType added in v1.6.15

func NewArrType(elem DataType, pos lexer.Pos, pointer bool) *ArrType

func (*ArrType) Decl

func (a *ArrType) Decl() string

func (*ArrType) ID added in v1.6.0

func (a *ArrType) ID() string

func (ArrType) Pointer added in v1.6.15

func (d ArrType) Pointer() bool

func (ArrType) Pos added in v1.6.15

func (d ArrType) Pos() lexer.Pos

type BaseType

type BaseType struct {
	DataType string
	// contains filtered or unexported fields
}

func NewBaseType added in v1.6.15

func NewBaseType(dataType string, pos lexer.Pos, pointer bool) *BaseType

func (*BaseType) Decl

func (b *BaseType) Decl() string

func (*BaseType) ID added in v1.6.0

func (b *BaseType) ID() string

func (BaseType) Pointer added in v1.6.15

func (d BaseType) Pointer() bool

func (BaseType) Pos added in v1.6.15

func (d BaseType) Pos() lexer.Pos

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
	// Pos returns the lexer position.
	Pos() lexer.Pos
}

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
	// contains filtered or unexported fields
}

func NewEnumType added in v1.6.15

func NewEnumType(name string, pos lexer.Pos, pointer bool) *EnumType

func (*EnumType) Decl

func (e *EnumType) Decl() string

func (*EnumType) ID added in v1.6.0

func (e *EnumType) ID() string

func (EnumType) Pointer added in v1.6.15

func (d EnumType) Pointer() bool

func (EnumType) Pos added in v1.6.15

func (d EnumType) Pos() lexer.Pos

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
	// contains filtered or unexported fields
}

func NewMapType added in v1.6.15

func NewMapType(key, value DataType, pos lexer.Pos, pointer bool) *MapType

func (*MapType) Decl

func (m *MapType) Decl() string

func (*MapType) ID added in v1.6.0

func (m *MapType) ID() string

func (MapType) Pointer added in v1.6.15

func (d MapType) Pointer() bool

func (MapType) Pos added in v1.6.15

func (d MapType) Pos() lexer.Pos

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
	// contains filtered or unexported fields
}

func NewStructType added in v1.6.15

func NewStructType(name string, pos lexer.Pos, pointer bool) *StructType

func (*StructType) Decl

func (s *StructType) Decl() string

func (*StructType) ID added in v1.6.0

func (s *StructType) ID() string

func (StructType) Pointer added in v1.6.15

func (d StructType) Pointer() bool

func (StructType) Pos added in v1.6.15

func (d StructType) Pos() lexer.Pos

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