Documentation
¶
Index ¶
Constants ¶
View Source
const EOS = 0
EOS is byte stream terminator
View Source
const VERSION = "1.1.4"
VERSION version of the tars2go tools.
Variables ¶
View Source
var (
GTarsPath = flag.String("tarsPath", "github.com/jslyzt/tarsgo/tars", "Specify the tars source path.")
)
View Source
var TokenMap = [...]string{ // contains filtered or unexported fields }
TokenMap record token value.
Functions ¶
This section is empty.
Types ¶
type EnumInfo ¶
type EnumInfo struct {
Module string
Name string
OriginName string // original name
Mb []EnumMember
}
EnumInfo record EnumMember information include name.
type EnumMember ¶
EnumMember record member information.
type FunInfo ¶
type FunInfo struct {
Name string // after the uppercase converted name
OriginName string // original name
HasRet bool
RetType *VarType
Args []ArgInfo
}
FunInfo record function information.
type GenGo ¶
type GenGo struct {
I []string // imports with path
Code bytes.Buffer
VC int // var count. Used to generate unique variable names
Path string
TarsPath string
Module string
Prefix string
P *Parse
// proto file name(not include .tars)
ProtoName string
}
GenGo record go code information.
type HashKeyInfo ¶
HashKeyInfo record hashkey information.
type InterfaceInfo ¶
type InterfaceInfo struct {
Name string
OriginName string // original name
Fun []FunInfo
DependModule map[string]bool
DependModuleWithJce map[string]string
}
InterfaceInfo record interface information.
type LexState ¶
type LexState struct {
// contains filtered or unexported fields
}
LexState record lexical state.
func NewLexState ¶
NewLexState to update LexState struct.
type Parse ¶
type Parse struct {
Source string
Module string
OriginModule string
Include []string
Struct []StructInfo
Interface []InterfaceInfo
Enum []EnumInfo
Const []ConstInfo
HashKey []HashKeyInfo
// have parsed include file
IncParse []*Parse
// jce include chain
IncChain []string
// proto file name(not include .tars)
ProtoName string
DependModuleWithJce map[string]bool
// contains filtered or unexported fields
}
Parse record information of parse file.
type StructInfo ¶
type StructInfo struct {
Name string
OriginName string //original name
Mb []StructMember
DependModule map[string]bool
DependModuleWithJce map[string]string
}
StructInfo record struct information.
type StructMember ¶
type StructMember struct {
Tag int32
Require bool
Type *VarType
Key string // after the uppercase converted key
OriginKey string // original key
Default string
DefType TK
Desc string // 描述
}
StructMember member struct.
type StructMemberSorter ¶
type StructMemberSorter []StructMember
StructMemberSorter When serializing, make sure the tags are ordered.
func (StructMemberSorter) Len ¶
func (a StructMemberSorter) Len() int
func (StructMemberSorter) Less ¶
func (a StructMemberSorter) Less(i, j int) bool
func (StructMemberSorter) Swap ¶
func (a StructMemberSorter) Swap(i, j int)
type VarType ¶
type VarType struct {
Type TK // basic type
Unsigned bool // whether unsigned
TypeSt string // custom type name, such as an enumerated struct,at this time Type=tkName
CType TK // make sure which type of custom type is,tkEnum, tkStruct
TypeK *VarType // vector's member variable,the key of map
TypeV *VarType // the value of map
TypeL int64 // lenth of array
}
VarType contains variable type(token)
Click to show internal directories.
Click to hide internal directories.