Documentation ¶
Index ¶
- Variables
- func AddPeer(peer string, entity *Entity)
- func AddPeerStruct(peer string, ptype string)
- func AddStructType(peer, ptype string) error
- func CheckTypeDefine(ptype string) bool
- func ConvertToLanguageType(ptype string) string
- func CreateAllDir(path string) error
- func CreateAllDirIfNotExists(path string) error
- func CreateDir(path string) error
- func EnvInit() error
- func Equal(a, b interface{}) bool
- func Execute()
- func GenFileByTemplate(filename string, tpl *template.Template, data interface{}) error
- func GetBytesCount(pparams, ptypes []string) string
- func GetFuncName(s string) string
- func GetMapKVType(typestr string) (ktype, vtype string)
- func GetSliceVType(typestr string) (vtype string)
- func GetStandardTypeBytesCount(ptype string) string
- func GetStructTypeName(ptype string) string
- func GetType(ptype string) string
- func IsLast(index, count int) bool
- func IsStructType(ptype string) bool
- func Minus(a, b int) int
- func NameToPeer(name string) byte
- func Plus(a, b int) int
- func ReadCsharpOldFuncBody(filename string, e *Entity)
- func ReadEntityCustomParams(filename string, e *Entity)
- func ReadLoadDataFuncBody(filename string, e *Entity)
- func ReadOldFuncBody(filename string, e *Entity)
- func ReadSectionFile(path string) (map[string]string, error)
- func RemoveEmptyElement(strarr []string) []string
- func TrimBlankLeftAndRight(str string) string
- func TrimLeftAndRight(str string, sep string) string
- func WriteSerializeType(writer io.Writer, ptype, pname string) error
- func WriteUnSerializeType(writer io.Writer, ptype, pname string) error
- type Basic
- type Entity
- type FuncData
- type FuncObj
- type IBuilder
- type Map
- type PeerData
- type PeerNode
- type PeerVertex
- type Server
- type Slice
- type Struct
- type StructObj
Constants ¶
This section is empty.
Variables ¶
View Source
var CsharpStandardTypeMap map[string]string = map[string]string{
"short": "short",
"ushort": "ushort",
"int": "int",
"uint": "uint",
"long": "long",
"ulong": "ulong",
"float": "float",
"double": "double",
"byte": "byte",
"bool": "bool",
"string": "string",
}
View Source
var CustomTypeMap map[string]string = map[string]string{}
View Source
var DefineToCsharpStandardTypeMap map[string]string = map[string]string{
"int16": "short",
"uint16": "ushort",
"int32": "int",
"uint32": "uint",
"int64": "long",
"uint64": "ulong",
"float32": "float",
"float64": "double",
"byte": "byte",
"bool": "bool",
"string": "string",
"...interface{}": "params object[]",
}
View Source
var GlobalStructs map[string]*StructObj = map[string]*StructObj{}
View Source
var StandardTypeMap map[string]string = map[string]string{
"int16": "int16",
"uint16": "uint16",
"int32": "int32",
"uint32": "uint32",
"int64": "int64",
"uint64": "uint64",
"float32": "float32",
"float64": "float64",
"byte": "byte",
"bool": "bool",
"string": "string",
"...interface{}": "...interface{}",
}
View Source
var StartMethodId = 1000
Functions ¶
func AddPeerStruct ¶
func AddStructType ¶
func CheckTypeDefine ¶
func ConvertToLanguageType ¶
func CreateAllDir ¶
func CreateAllDirIfNotExists ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GenFileByTemplate ¶
func GetBytesCount ¶
func GetFuncName ¶
func GetMapKVType ¶
func GetSliceVType ¶
func GetStructTypeName ¶
func IsStructType ¶
func NameToPeer ¶
func ReadCsharpOldFuncBody ¶
func ReadEntityCustomParams ¶
func ReadLoadDataFuncBody ¶
func ReadOldFuncBody ¶
func RemoveEmptyElement ¶
func TrimBlankLeftAndRight ¶
func TrimLeftAndRight ¶
Types ¶
type Entity ¶
type Entity struct { //Server string IsUserEntity bool `json:"isuserentity"` IsCreateOnStart bool `json:"iscreateonstart"` HasRPC bool `json:"hasrpc"` HasWatcher bool `json:"haswatcher"` IsServer bool Path string TypeId uint16 EntityName string TitledEntityName string FuncNames map[string]*FuncObj Funcs []*FuncObj AllReqFuncs []*FuncObj AllRespFuncs []*FuncObj ModuleReqFuncs map[string][]*FuncObj ModuleRespFuncs map[string][]*FuncObj FuncModules []string FuncsCfgMap map[string][]*FuncData CurSendFuncs []*FuncObj CurRecvFuncs []*FuncObj CurFuncs []*FuncObj CurPeer string PeerSend map[string]map[string][]*FuncObj PeerRecv map[string]map[string][]*FuncObj CustomParams string LoadDataFuncBody string CurImports string StartMethodId int VerifyMethod string }
type FuncObj ¶
type FuncObj struct { FileName string Line int Content string Name string ParamsName []string ParamsType []string ParamsBytesString string IsReq bool IsCallback bool OldFuncBody string SerializeParams string UnSerializeParams string SendPeerMap map[string]map[string]string //map[sendpeer][transpeer]topeer TransferMap map[string]map[string]struct{} //map[transferpeer][]topeer SendPeers []string RecvPeers []string }
type PeerNode ¶
gen discovery info:if not client , for example lobby need discovery gate gen balance info:if not client, for example gate need balance info of lobby
type PeerVertex ¶
type PeerVertex struct {
Name string
}
func (*PeerVertex) CompareTo ¶
func (pv *PeerVertex) CompareTo(m interface{}) int
func (*PeerVertex) Equals ¶
func (pv *PeerVertex) Equals(m interface{}) bool
func (*PeerVertex) String ¶
func (pv *PeerVertex) String() string
type Server ¶
func (*Server) GenEntityIdFile ¶
Click to show internal directories.
Click to hide internal directories.