Documentation ¶
Index ¶
- Constants
- Variables
- func CreateBinaryLongPacket(data []byte, idx int) ([]byte, error)
- func CreateJsonLongPacket(data []byte, idx int) ([]byte, error)
- func CreateLongPacket(protocol TYPE) func(data []byte, idx int) ([]byte, error)
- func GetLineRegExps() map[string]*regexp.Regexp
- func IsProtobuf() bool
- func MarshalBinary(s interface{}) ([]byte, error)
- func MarshalBinaryMessage(transId uint32, data interface{}) (ret []byte, err error)
- func MarshalJsonMessage(transId uint32, data interface{}) (ret []byte, err error)
- func MarshalMessage(transId uint32, data interface{}, t TYPE) (ret []byte, err error)
- func MatchGoProtoTag(s string) bool
- func PickBinaryLongPacket(data []byte) (bool, int, []byte)
- func PickJsonLongPacket(data []byte) (bool, int, []byte)
- func PickLongPacket(protocol TYPE) func(data []byte) (bool, int, []byte)
- func SetProtobuf()
- func SetTypeRegistry(registry *TypeRegistry)
- func Split(data []byte, atEOF bool) (advance int, token []byte, err error)
- func Unmarshal(data []byte, v interface{}) (err error)
- func UnmarshalFromBytes(data []byte, v interface{}) error
- type BINARY_LENGTH
- type BINARY_NAME_SIZE
- type BINARY_TAG
- func GetCmdId(data []byte) BINARY_TAG
- func GetCmdId16(data []byte) BINARY_TAG
- func GetCmdIdFromType(data interface{}) (BINARY_TAG, error)
- func GetModelProtoTag(s string) BINARY_TAG
- func MatchGoSystemTag(s string) (BINARY_TAG, string, string)
- func MatchModelProtoTag(s string) BINARY_TAG
- func MatchModelSystemTag(s string) (BINARY_TAG, string, string)
- func (tag BINARY_TAG) CsTypeString() string
- func (tag BINARY_TAG) GoTypeString() string
- func (tag BINARY_TAG) IsArrayLike() bool
- func (tag BINARY_TAG) IsBaseValue() bool
- func (tag BINARY_TAG) IsProto() bool
- func (this BINARY_TAG) MatchRegExp(str string) bool
- func (tag BINARY_TAG) String() string
- func (tag BINARY_TAG) TsTagString() string
- func (tag BINARY_TAG) TsTypeString() string
- type BinaryMessage
- type CommentObject
- type ComposeData
- type Compression
- type ConfFile
- type ConfObject
- type ContainerType
- type DefaultGeneratorFile
- func (this *DefaultGeneratorFile) AddObject(obj GeneratorObject)
- func (this *DefaultGeneratorFile) CheckFinish(offset int) bool
- func (this *DefaultGeneratorFile) Generate(typ FileType) *promise.Promise
- func (this *DefaultGeneratorFile) GetFile() GeneratorFile
- func (this *DefaultGeneratorFile) GetFilePath() string
- func (this *DefaultGeneratorFile) GetGoRelativePath() string
- func (this *DefaultGeneratorFile) GetLines() []*LineText
- func (this *DefaultGeneratorFile) GetObj(objType ObjectType) []GeneratorObject
- func (this *DefaultGeneratorFile) GetTsRelativePath() string
- func (this *DefaultGeneratorFile) InsertAfter(obj GeneratorObject, after GeneratorObject)
- func (this *DefaultGeneratorFile) InsertObject(pos int, obj GeneratorObject)
- func (this *DefaultGeneratorFile) Load(path string) *promise.Promise
- func (this *DefaultGeneratorFile) MarshalToFile(path string) *promise.Promise
- func (this *DefaultGeneratorFile) Parse() *promise.Promise
- func (this *DefaultGeneratorFile) RemoveAutoGenHeader()
- func (this *DefaultGeneratorFile) RemoveObjByCondition(condition GenerateObjRemoveCondition)
- func (this *DefaultGeneratorFile) RemoveObjType(objType ObjectType)
- func (this *DefaultGeneratorFile) SetGenerator(generator *Generator)
- type DefaultGeneratorObj
- func (this *DefaultGeneratorObj) AddLine(line *LineText, lineType LineType) *LineText
- func (this *DefaultGeneratorObj) CheckLine(line *LineText) bool
- func (this *DefaultGeneratorObj) File() GeneratorFile
- func (this *DefaultGeneratorObj) GenerateToObject(typ ObjectType) GeneratorObject
- func (this *DefaultGeneratorObj) GetFile() GeneratorFile
- func (this *DefaultGeneratorObj) GetLines(lineType LineType) []*LineText
- func (this *DefaultGeneratorObj) InsertAfter(line *LineText, after *LineText) *LineText
- func (this *DefaultGeneratorObj) InsertLine(pos int, line *LineText) *LineText
- func (this *DefaultGeneratorObj) Lines() []*LineText
- func (this *DefaultGeneratorObj) Name() string
- func (this *DefaultGeneratorObj) ObjectType() ObjectType
- func (this *DefaultGeneratorObj) RemoveLineType(lineType LineType) []*LineText
- func (this *DefaultGeneratorObj) String() string
- func (this *DefaultGeneratorObj) TryAddLine(line *LineText, lineType LineType) bool
- func (this *DefaultGeneratorObj) TryAddLineStrict(line *LineText, lineType LineType) bool
- type EmptyObject
- type Enum
- type ErrCode
- type ErrMsg
- type Fields
- type FileType
- type GenType
- type GenerateObjRemoveCondition
- type Generator
- func (this *Generator) Clear()
- func (this *Generator) GenerateGo2Ts()
- func (this *Generator) GenerateGo2TsIds()
- func (this *Generator) GenerateGoIds(fromProto bool)
- func (this *Generator) GenerateModel2Cs() error
- func (this *Generator) GenerateModel2Go() error
- func (this *Generator) GenerateModel2Ts()
- func (this *Generator) GenerateProto2Go() error
- func (this *Generator) GenerateProto2GoIds()
- func (this *Generator) GenerateProto2Ids()
- func (this *Generator) GenerateProto2Ts() error
- func (this *Generator) GenerateProto2TsIds()
- func (this *Generator) GenerateProto2TsJsImport()
- func (this *Generator) GenerateTsEnum()
- func (this *Generator) GenerateTsModels()
- func (this *Generator) InitDefaultSchemas()
- func (this *Generator) LoadAndParseTsFile(modelsPath string) (*TsModelFile, error)
- func (this *Generator) LoadConf(p string) error
- func (this *Generator) LoadCsFolder(p string) *promise.Promise
- func (this *Generator) LoadGo2TsFolder(p string, individual bool) *promise.Promise
- func (this *Generator) LoadGo2TsIds(p string) error
- func (this *Generator) LoadGo2TsModels(p string) error
- func (this *Generator) LoadGoFolder(p string) *promise.Promise
- func (this *Generator) LoadGoIds(p string) error
- func (this *Generator) LoadGoModels(p string) error
- func (this *Generator) LoadModelFolder(p string) *promise.Promise
- func (this *Generator) LoadModels(p string) error
- func (this *Generator) LoadProtoFolder(p string) *promise.Promise
- func (this *Generator) LoadProtoIds(p string) error
- func (this *Generator) LoadProtos(p string) error
- func (this *Generator) LoadTsEnums(p string) error
- func (this *Generator) MatchGoEnum(s string) bool
- func (this *Generator) MatchGoExistTag(s string) (tag BINARY_TAG, isEnum bool, tagstr1 string, tagstr2 string)
- func (this *Generator) MatchGoStruct(s string) BINARY_TAG
- func (this *Generator) PostProcessAllGoSchemas()
- func (this *Generator) ProcessGoModel2Schema(model *GoStructObject)
- func (this *Generator) SetOption(opt GeneratorOption)
- func (this *Generator) SetProto2GoCmdLine(f func(pack, protoPath, GoPath string) error)
- func (this *Generator) SetProto2TsCmdLine(f func(pack, protoPath, TsPath string) error)
- type GeneratorFile
- type GeneratorObject
- type GeneratorOption
- type GoAssignedId
- type GoDefineObject
- type GoEnumObject
- type GoFuncObject
- type GoIdObject
- type GoIdRegObject
- type GoIdsFile
- type GoImportObject
- type GoInterfaceObject
- type GoModelFile
- type GoPackageObject
- type GoStructFields
- type GoStructFuncObject
- type GoStructObject
- type GoVarObject
- type HandShake
- type IError
- type ISerializable
- type JsonEnumFields
- type JsonMsg
- type JsonMsgField
- type JsonMsgFields
- type JsonSchema
- type LineText
- func (this *LineText) GetName() string
- func (this *LineText) GetPkgName() string
- func (this *LineText) GetStructName() string
- func (this *LineText) GetTagName() string
- func (this *LineText) GetTypeName() string
- func (this *LineText) GetValue() int
- func (this *LineText) IsLongStringTag() bool
- func (this *LineText) ObjName() string
- func (this *LineText) Parse() string
- type LineType
- func (this LineType) Parse(origin string, args map[string]string) string
- func (this LineType) RegExp() *regexp.Regexp
- func (this LineType) RegMatch(str string) bool
- func (this LineType) RegReplaceName(str string) string
- func (this LineType) RegReplacePkg(str string) string
- func (this LineType) RegReplaceStructName(str string) string
- func (this LineType) RegReplaceTagName(str string) string
- func (this LineType) RegReplaceType(str string) string
- func (this LineType) RegReplaceValue(str string) string
- func (this LineType) String() string
- type ModelClassFields
- type ModelClassObject
- type ModelEnumObject
- type ModelFile
- func (this *ModelFile) Generate() *promise.Promise
- func (this *ModelFile) Parse() *promise.Promise
- func (this *ModelFile) ProcessEnums() []*ModelEnumObject
- func (this *ModelFile) ProcessIds() []*ModelId
- func (this *ModelFile) ProcessModels() []*ModelClassObject
- func (this *ModelFile) ProcessPackages() *ModelPackageObject
- type ModelId
- func (this *ModelId) GetCsIdRegisterString() string
- func (this *ModelId) GetCsMessageRegisterString() string
- func (this *ModelId) GetCsProtocolFuncString() string
- func (this *ModelId) GetGoIdAssignString() string
- func (this *ModelId) GetGoIdRegisterString() string
- func (this *ModelId) GetGoProtocolFuncString() string
- type ModelIdsObject
- type ModelImportObject
- type ModelPackageObject
- func (this *ModelPackageObject) CheckLine(line *LineText) bool
- func (this *ModelPackageObject) CsString() string
- func (this *ModelPackageObject) GetCsFuncString() string
- func (this *ModelPackageObject) GetCsIdRegString() string
- func (this *ModelPackageObject) GetCsMessageRegString() string
- func (this *ModelPackageObject) GetCsPackageName() string
- func (this *ModelPackageObject) GetGoFuncString() string
- func (this *ModelPackageObject) GetGoIdAssignString() string
- func (this *ModelPackageObject) GetGoIdRegString() string
- func (this *ModelPackageObject) GetGoPackageName() string
- func (this *ModelPackageObject) GoString() string
- type ModelSchema
- func (this *ModelSchema) SetGoRelativePath(goPath string)
- func (this *ModelSchema) ToJsonSchema() string
- func (this *ModelSchema) ToLineEnd() string
- func (this *ModelSchema) ToLineObject() []string
- func (this *ModelSchema) ToLineStart() string
- func (this *ModelSchema) ToSingleLine() string
- func (this *ModelSchema) ToTsClassHeader() string
- func (this *ModelSchema) ToTsPublicSingleLine() string
- func (this *ModelSchema) ToTsPublicType() string
- type ObjectId
- type ObjectType
- type Ping
- type Pong
- type ProtoEnumObject
- type ProtoField
- type ProtoFile
- type ProtoIdsFile
- type ProtoIdsObj
- type ProtoMsgObject
- type ProtoPackageObj
- type ProtoSyntaxObj
- type RouteMessage
- type TYPE
- type TomlSchema
- type TsClassMember
- type TsClassObject
- func (this *TsClassObject) CheckLine(line *LineText) bool
- func (this *TsClassObject) CheckLongString(mName string) bool
- func (this *TsClassObject) GetClassMember(s string) *TsClassMember
- func (this *TsClassObject) GetClassName() string
- func (this *TsClassObject) IsModel() bool
- func (this *TsClassObject) Name() string
- type TsEnumFile
- type TsEnumObject
- type TsFuncObject
- type TsIdsFile
- type TsIdsObject
- type TsImportObject
- type TsModelFile
- type TsVarObject
- type TypeRegistry
- func (this *TypeRegistry) GetInterfaceByTag(t BINARY_TAG) (ISerializable, error)
- func (this *TypeRegistry) GetNameByType(t reflect.Type) string
- func (this *TypeRegistry) GetTagByName(s string) BINARY_TAG
- func (this *TypeRegistry) GetTagByType(p reflect.Type) (BINARY_TAG, error)
- func (this *TypeRegistry) GetTagName(t BINARY_TAG) string
- func (this *TypeRegistry) GetTypeByTag(t BINARY_TAG) (reflect.Type, error)
- func (this *TypeRegistry) RegistrySystemTag(t BINARY_TAG, s string)
- func (this *TypeRegistry) RegistryTemplateTag(t BINARY_TAG, s string)
- func (this *TypeRegistry) RegistryType(t BINARY_TAG, p reflect.Type)
Constants ¶
View Source
const ( TS_CLASSOBJ_HEADER = iota TS_CLASSOBJ_DEFINER TS_CLASSOBJ_MEMBER_FIELD TS_CLASSOBJ_CONSTRUCTOR TS_CLASSOBJ_GETTER_SETTER TS_CLASSOBJ_FUNCTION_FIELD TS_CLASSOBJ_FUNCTION TS_CLASSOBJ_CLASS_END )
View Source
const ( // len 2 transId 4 HEADER_SIZE = 2 + 4 MAX_PACKET_SIZE = 20 * 1024 DEFAULT_PACKET_LEN = 2048 * 4 ROUTE_MSG_ADDITION = 2 + 8 + 8 )
Variables ¶
View Source
var ( //inner error ErrTypeNotFound = CreateError(-1, "type not found") ErrRpcTimeOut = CreateError(-2, "rpc timeout") ErrPacketWrongFormat = CreateError(-3, "wrong packet format") ErrInternalError = CreateError(-4, "internal error") ErrActorNotExist = CreateError(-101, "actor not found") //cs error ErrInternalServer = CreateError(901, "服务器繁忙") ErrTokenExpired = CreateError(1001, "Token已过期") ErrTokenValidate = CreateError(1002, "Token无效") ErrAccNotFind = CreateError(1003, "找不到账户") ErrGameAccNotFind = CreateError(1004, "找不到游戏账户") ErrGameAccAlreadyExist = CreateError(1011, "游戏账户已存在") ErrGameAccCreateFailed = CreateError(1012, "创建游戏账户失败") ErrParamNotExist = CreateError(1101, "参数不存在") ErrParamError = CreateError(1102, "参数错误") ErrPassAuthError = CreateError(1103, "账户不存在或者密码错误") ErrPasswordNeeded = CreateError(1104, "需要输入密码") ErrAuthFailed = CreateError(1201, "验证失败") ErrMsgFormat = CreateError(1202, "数据格式错误") )
View Source
var COMMENT_REGEXP = regexp.MustCompile(`(.*)((//).*)`)
View Source
var ICOMPONENT_REGEXP = regexp.MustCompile(`Component`)
View Source
var ISERIALIZABLE_REGEXP = regexp.MustCompile(`Serializable`)
Functions ¶
func CreateLongPacket ¶
func GetLineRegExps ¶
func IsProtobuf ¶
func IsProtobuf() bool
func MarshalBinary ¶
func MarshalBinaryMessage ¶
func MarshalJsonMessage ¶
func MarshalMessage ¶
func MatchGoProtoTag ¶
func SetProtobuf ¶
func SetProtobuf()
func SetTypeRegistry ¶
func SetTypeRegistry(registry *TypeRegistry)
func UnmarshalFromBytes ¶
Types ¶
type BINARY_LENGTH ¶
type BINARY_LENGTH uint32
type BINARY_NAME_SIZE ¶
type BINARY_NAME_SIZE int16
type BINARY_TAG ¶
type BINARY_TAG uint16
const ( //基础类型 0-40 TAG_End BINARY_TAG = iota TAG_Bool TAG_Byte TAG_Short TAG_UShort TAG_Int TAG_UInt TAG_Long TAG_ULong TAG_Float TAG_Double TAG_String TAG_BoolArray TAG_ByteArray TAG_ShortArray TAG_UShortArray TAG_IntArray TAG_UIntArray TAG_LongArray TAG_ULongArray TAG_FloatArray TAG_DoubleArray TAG_List TAG_Map TAG_Buffer TAG_Time TAG_Decimal TAG_Proto TAG_Null TAG_LongString //Ecs TAG_EntityRef BINARY_TAG = 32 //系统预留类型 40-127 TAG_BinaryMessage BINARY_TAG = 40 //保留基本传输类型 TAG_Error BINARY_TAG = 41 TAG_Compose BINARY_TAG = 42 TAG_Ping BINARY_TAG = 43 TAG_Pong BINARY_TAG = 44 TAG_HandShake BINARY_TAG = 45 TAG_RouteMessage BINARY_TAG = 46 )
func GetCmdId ¶
func GetCmdId(data []byte) BINARY_TAG
func GetCmdId16 ¶
func GetCmdId16(data []byte) BINARY_TAG
func GetCmdIdFromType ¶
func GetCmdIdFromType(data interface{}) (BINARY_TAG, error)
func GetModelProtoTag ¶
func GetModelProtoTag(s string) BINARY_TAG
func MatchGoSystemTag ¶
func MatchGoSystemTag(s string) (BINARY_TAG, string, string)
func MatchModelProtoTag ¶
func MatchModelProtoTag(s string) BINARY_TAG
func MatchModelSystemTag ¶
func MatchModelSystemTag(s string) (BINARY_TAG, string, string)
func (BINARY_TAG) CsTypeString ¶
func (tag BINARY_TAG) CsTypeString() string
func (BINARY_TAG) GoTypeString ¶
func (tag BINARY_TAG) GoTypeString() string
func (BINARY_TAG) IsArrayLike ¶
func (tag BINARY_TAG) IsArrayLike() bool
func (BINARY_TAG) IsBaseValue ¶
func (tag BINARY_TAG) IsBaseValue() bool
func (BINARY_TAG) IsProto ¶
func (tag BINARY_TAG) IsProto() bool
func (BINARY_TAG) MatchRegExp ¶
func (this BINARY_TAG) MatchRegExp(str string) bool
func (BINARY_TAG) String ¶
func (tag BINARY_TAG) String() string
func (BINARY_TAG) TsTagString ¶
func (tag BINARY_TAG) TsTagString() string
func (BINARY_TAG) TsTypeString ¶
func (tag BINARY_TAG) TsTypeString() string
type BinaryMessage ¶
type BinaryMessage struct { ISerializable TransId uint32 Len uint16 CmdId BINARY_TAG Body ISerializable }
BinaryMessage base protocol
func UnmarshalBinaryMessage ¶
func UnmarshalBinaryMessage(data []byte) (*BinaryMessage, error)
func UnmarshalJsonMessage ¶
func UnmarshalJsonMessage(data []byte) (*BinaryMessage, error)
func UnmarshalMessage ¶
func UnmarshalMessage(data []byte, t TYPE) (*BinaryMessage, error)
func (*BinaryMessage) GetId ¶
func (this *BinaryMessage) GetId() (BINARY_TAG, error)
func (*BinaryMessage) Marshal ¶
func (this *BinaryMessage) Marshal() ([]byte, error)
func (*BinaryMessage) Unmarshal ¶
func (this *BinaryMessage) Unmarshal(from []byte) error
type CommentObject ¶
type CommentObject struct { DefaultGeneratorObj // contains filtered or unexported fields }
func NewCommentObject ¶
func NewCommentObject(file GeneratorFile) *CommentObject
func (*CommentObject) CheckLine ¶
func (this *CommentObject) CheckLine(line *LineText) bool
type ComposeData ¶
func (*ComposeData) GetId ¶
func (this *ComposeData) GetId() (BINARY_TAG, error)
func (*ComposeData) Marshal ¶
func (this *ComposeData) Marshal() ([]byte, error)
func (*ComposeData) Serializable ¶
func (this *ComposeData) Serializable() ISerializable
func (*ComposeData) Unmarshal ¶
func (this *ComposeData) Unmarshal(from []byte) error
type Compression ¶
type Compression byte
const ( Uncompressed Compression = 0 GZip Compression = 1 ZLib Compression = 2 )
type ConfFile ¶
type ConfFile struct { *DefaultGeneratorFile TagName string PackageName string Offset int Recursive bool }
func NewConfFile ¶
type ConfObject ¶
type ConfObject struct {
DefaultGeneratorObj
}
func NewConfObject ¶
func NewConfObject(file GeneratorFile) *ConfObject
func (*ConfObject) CheckLine ¶
func (this *ConfObject) CheckLine(line *LineText) bool
type ContainerType ¶
type ContainerType int
const ( CTYPE_NONE ContainerType = iota CTYPE_PROTO CTYPE_ARRAY CTYPE_MAP )
type DefaultGeneratorFile ¶
type DefaultGeneratorFile struct { GeneratorFile FileType FileType FilePath string IsDir bool Generator *Generator DirPath string FileName string LineLength int Lines []*LineText Objects []GeneratorObject // contains filtered or unexported fields }
func NewGeneratorFile ¶
func NewGeneratorFile(generator *Generator) *DefaultGeneratorFile
func (*DefaultGeneratorFile) AddObject ¶
func (this *DefaultGeneratorFile) AddObject(obj GeneratorObject)
func (*DefaultGeneratorFile) CheckFinish ¶
func (this *DefaultGeneratorFile) CheckFinish(offset int) bool
func (*DefaultGeneratorFile) Generate ¶
func (this *DefaultGeneratorFile) Generate(typ FileType) *promise.Promise
func (*DefaultGeneratorFile) GetFile ¶
func (this *DefaultGeneratorFile) GetFile() GeneratorFile
func (*DefaultGeneratorFile) GetFilePath ¶
func (this *DefaultGeneratorFile) GetFilePath() string
func (*DefaultGeneratorFile) GetGoRelativePath ¶
func (this *DefaultGeneratorFile) GetGoRelativePath() string
func (*DefaultGeneratorFile) GetLines ¶
func (this *DefaultGeneratorFile) GetLines() []*LineText
func (*DefaultGeneratorFile) GetObj ¶
func (this *DefaultGeneratorFile) GetObj(objType ObjectType) []GeneratorObject
func (*DefaultGeneratorFile) GetTsRelativePath ¶
func (this *DefaultGeneratorFile) GetTsRelativePath() string
func (*DefaultGeneratorFile) InsertAfter ¶
func (this *DefaultGeneratorFile) InsertAfter(obj GeneratorObject, after GeneratorObject)
func (*DefaultGeneratorFile) InsertObject ¶
func (this *DefaultGeneratorFile) InsertObject(pos int, obj GeneratorObject)
func (*DefaultGeneratorFile) Load ¶
func (this *DefaultGeneratorFile) Load(path string) *promise.Promise
func (*DefaultGeneratorFile) MarshalToFile ¶
func (this *DefaultGeneratorFile) MarshalToFile(path string) *promise.Promise
func (*DefaultGeneratorFile) Parse ¶
func (this *DefaultGeneratorFile) Parse() *promise.Promise
func (*DefaultGeneratorFile) RemoveAutoGenHeader ¶
func (this *DefaultGeneratorFile) RemoveAutoGenHeader()
func (*DefaultGeneratorFile) RemoveObjByCondition ¶
func (this *DefaultGeneratorFile) RemoveObjByCondition(condition GenerateObjRemoveCondition)
func (*DefaultGeneratorFile) RemoveObjType ¶
func (this *DefaultGeneratorFile) RemoveObjType(objType ObjectType)
func (*DefaultGeneratorFile) SetGenerator ¶
func (this *DefaultGeneratorFile) SetGenerator(generator *Generator)
type DefaultGeneratorObj ¶
type DefaultGeneratorObj struct {
// contains filtered or unexported fields
}
func (*DefaultGeneratorObj) AddLine ¶
func (this *DefaultGeneratorObj) AddLine(line *LineText, lineType LineType) *LineText
func (*DefaultGeneratorObj) CheckLine ¶
func (this *DefaultGeneratorObj) CheckLine(line *LineText) bool
func (*DefaultGeneratorObj) File ¶
func (this *DefaultGeneratorObj) File() GeneratorFile
func (*DefaultGeneratorObj) GenerateToObject ¶
func (this *DefaultGeneratorObj) GenerateToObject(typ ObjectType) GeneratorObject
func (*DefaultGeneratorObj) GetFile ¶
func (this *DefaultGeneratorObj) GetFile() GeneratorFile
func (*DefaultGeneratorObj) GetLines ¶
func (this *DefaultGeneratorObj) GetLines(lineType LineType) []*LineText
func (*DefaultGeneratorObj) InsertAfter ¶
func (this *DefaultGeneratorObj) InsertAfter(line *LineText, after *LineText) *LineText
func (*DefaultGeneratorObj) InsertLine ¶
func (this *DefaultGeneratorObj) InsertLine(pos int, line *LineText) *LineText
func (*DefaultGeneratorObj) Lines ¶
func (this *DefaultGeneratorObj) Lines() []*LineText
func (*DefaultGeneratorObj) Name ¶
func (this *DefaultGeneratorObj) Name() string
func (*DefaultGeneratorObj) ObjectType ¶
func (this *DefaultGeneratorObj) ObjectType() ObjectType
func (*DefaultGeneratorObj) RemoveLineType ¶
func (this *DefaultGeneratorObj) RemoveLineType(lineType LineType) []*LineText
func (*DefaultGeneratorObj) String ¶
func (this *DefaultGeneratorObj) String() string
func (*DefaultGeneratorObj) TryAddLine ¶
func (this *DefaultGeneratorObj) TryAddLine(line *LineText, lineType LineType) bool
func (*DefaultGeneratorObj) TryAddLineStrict ¶
func (this *DefaultGeneratorObj) TryAddLineStrict(line *LineText, lineType LineType) bool
type EmptyObject ¶
type EmptyObject struct {
DefaultGeneratorObj
}
func NewEmptyObject ¶
func NewEmptyObject(file GeneratorFile) *EmptyObject
func (*EmptyObject) CheckLine ¶
func (this *EmptyObject) CheckLine(line *LineText) bool
type ErrMsg ¶
func NewErrorMsg ¶
func (*ErrMsg) GetId ¶
func (this *ErrMsg) GetId() (BINARY_TAG, error)
func (*ErrMsg) Serializable ¶
func (this *ErrMsg) Serializable() ISerializable
type GenerateObjRemoveCondition ¶
type GenerateObjRemoveCondition func(object GeneratorObject) bool
type Generator ¶
type Generator struct { GenType GenType Models map[string]GeneratorFile GoModels map[string]GeneratorFile Protos map[string]GeneratorFile GoIds *GoIdsFile ProtoIds *ProtoIdsFile Conf *ConfFile GoStructObjects []*GoStructObject GoEnumObjects []*GoEnumObject ProtoMsgObjects []*ProtoMsgObject ModelClassObjects []*ModelClassObject ModelEnumObjects []*ModelEnumObject ModelIdsObjects map[uint16]*ModelId ModelPackages map[string]*ModelPackageObject TsModels []*TsModelFile TsIds *TsIdsFile TsEnums *TsEnumFile TsClassObjects []*TsClassObject TsEnumObjects []*TsEnumObject Schemas []*ModelSchema Individual bool TsDependPath string GoPath string TsPath string ProtoPath string ModelPath string CsPath string Proto2GoCmdLinExec func(pack, protoPath, GoPath string) error Proto2TsCmdLinExec func(pack, protoPath, GoPath string) error }
func NewGenerator ¶
func (*Generator) GenerateGo2Ts ¶
func (this *Generator) GenerateGo2Ts()
func (*Generator) GenerateGo2TsIds ¶
func (this *Generator) GenerateGo2TsIds()
func (*Generator) GenerateGoIds ¶
func (*Generator) GenerateModel2Cs ¶
func (*Generator) GenerateModel2Go ¶
func (*Generator) GenerateModel2Ts ¶
func (this *Generator) GenerateModel2Ts()
func (*Generator) GenerateProto2Go ¶
func (*Generator) GenerateProto2GoIds ¶
func (this *Generator) GenerateProto2GoIds()
func (*Generator) GenerateProto2Ids ¶
func (this *Generator) GenerateProto2Ids()
func (*Generator) GenerateProto2Ts ¶
func (*Generator) GenerateProto2TsIds ¶
func (this *Generator) GenerateProto2TsIds()
func (*Generator) GenerateProto2TsJsImport ¶
func (this *Generator) GenerateProto2TsJsImport()
func (*Generator) GenerateTsEnum ¶
func (this *Generator) GenerateTsEnum()
func (*Generator) GenerateTsModels ¶
func (this *Generator) GenerateTsModels()
func (*Generator) InitDefaultSchemas ¶
func (this *Generator) InitDefaultSchemas()
func (*Generator) LoadAndParseTsFile ¶
func (this *Generator) LoadAndParseTsFile(modelsPath string) (*TsModelFile, error)
func (*Generator) LoadGo2TsFolder ¶
func (*Generator) LoadGo2TsIds ¶
func (*Generator) LoadGo2TsModels ¶
func (*Generator) LoadGoModels ¶
func (*Generator) LoadModelFolder ¶
func (*Generator) LoadModels ¶
func (*Generator) LoadProtoFolder ¶
func (*Generator) LoadProtoIds ¶
func (*Generator) LoadProtos ¶
func (*Generator) LoadTsEnums ¶
func (*Generator) MatchGoEnum ¶
func (*Generator) MatchGoExistTag ¶
func (*Generator) MatchGoStruct ¶
func (this *Generator) MatchGoStruct(s string) BINARY_TAG
func (*Generator) PostProcessAllGoSchemas ¶
func (this *Generator) PostProcessAllGoSchemas()
func (*Generator) ProcessGoModel2Schema ¶
func (this *Generator) ProcessGoModel2Schema(model *GoStructObject)
func (*Generator) SetOption ¶
func (this *Generator) SetOption(opt GeneratorOption)
func (*Generator) SetProto2GoCmdLine ¶
func (*Generator) SetProto2TsCmdLine ¶
type GeneratorFile ¶
type GeneratorFile interface { Parse() *promise.Promise Load(string) *promise.Promise GetFilePath() string GetTsRelativePath() string GetGoRelativePath() string SetGenerator(generator *Generator) GetLines() []*LineText GetFile() GeneratorFile AddObject(obj GeneratorObject) InsertObject(pos int, obj GeneratorObject) }
type GeneratorObject ¶
type GeneratorObject interface { Name() string File() GeneratorFile ObjectType() ObjectType GenerateToObject(typ ObjectType) GeneratorObject Lines() []*LineText GetLines(lineType LineType) []*LineText CheckLine(line *LineText) bool AddLine(line *LineText, lineType LineType) *LineText TryAddLine(line *LineText, lineType LineType) bool RemoveLineType(lineType LineType) []*LineText InsertLine(pos int, line *LineText) *LineText InsertAfter(line *LineText, after *LineText) *LineText String() string }
type GeneratorOption ¶
type GoAssignedId ¶
type GoDefineObject ¶
type GoDefineObject struct {
DefaultGeneratorObj
}
func NewGoDefineObject ¶
func NewGoDefineObject(file GeneratorFile) *GoDefineObject
func (*GoDefineObject) CheckLine ¶
func (this *GoDefineObject) CheckLine(line *LineText) bool
type GoEnumObject ¶
type GoEnumObject struct { DefaultGeneratorObj // contains filtered or unexported fields }
func NewGoEnumObject ¶
func NewGoEnumObject(file GeneratorFile) *GoEnumObject
func (*GoEnumObject) CheckLine ¶
func (this *GoEnumObject) CheckLine(line *LineText) bool
func (*GoEnumObject) Type ¶
func (this *GoEnumObject) Type() string
type GoFuncObject ¶
type GoFuncObject struct {
DefaultGeneratorObj
}
func NewGoFuncObject ¶
func NewGoFuncObject(file GeneratorFile) *GoFuncObject
func (*GoFuncObject) CheckLine ¶
func (this *GoFuncObject) CheckLine(line *LineText) bool
type GoIdObject ¶
type GoIdObject struct {
DefaultGeneratorObj
}
func NewGoIdObject ¶
func NewGoIdObject(file GeneratorFile) *GoIdObject
func (*GoIdObject) CheckLine ¶
func (this *GoIdObject) CheckLine(line *LineText) bool
type GoIdRegObject ¶
type GoIdRegObject struct {
DefaultGeneratorObj
}
func NewGoIdRegObject ¶
func NewGoIdRegObject(file GeneratorFile) *GoIdRegObject
func (*GoIdRegObject) CheckLine ¶
func (this *GoIdRegObject) CheckLine(line *LineText) bool
type GoIdsFile ¶
type GoIdsFile struct { *DefaultGeneratorFile TagName string Offset int AssignedIds []*GoAssignedId AssignedTypes []*GoAssignedId MinId int MaxId int }
func NewGoIdsFile ¶
func (*GoIdsFile) ProcessIds ¶
func (this *GoIdsFile) ProcessIds()
type GoImportObject ¶
type GoImportObject struct {
DefaultGeneratorObj
}
func NewGoImportObject ¶
func NewGoImportObject(file GeneratorFile) *GoImportObject
func (*GoImportObject) CheckLine ¶
func (this *GoImportObject) CheckLine(line *LineText) bool
type GoInterfaceObject ¶
type GoInterfaceObject struct { DefaultGeneratorObj // contains filtered or unexported fields }
func NewGoInterfaceObject ¶
func NewGoInterfaceObject(file GeneratorFile) *GoInterfaceObject
func (*GoInterfaceObject) CheckLine ¶
func (this *GoInterfaceObject) CheckLine(line *LineText) bool
type GoModelFile ¶
type GoModelFile struct {
*DefaultGeneratorFile
}
func NewGoModelFile ¶
func NewGoModelFile(generator *Generator) *GoModelFile
func (*GoModelFile) Generate ¶
func (this *GoModelFile) Generate() *promise.Promise
func (*GoModelFile) Parse ¶
func (this *GoModelFile) Parse() *promise.Promise
func (*GoModelFile) ProcessEnum ¶
func (this *GoModelFile) ProcessEnum() []*GoEnumObject
func (*GoModelFile) ProcessStruct ¶
func (this *GoModelFile) ProcessStruct() []*GoStructObject
type GoPackageObject ¶
type GoPackageObject struct { DefaultGeneratorObj // contains filtered or unexported fields }
func NewGoPackageObject ¶
func NewGoPackageObject(file GeneratorFile) *GoPackageObject
func (*GoPackageObject) CheckLine ¶
func (this *GoPackageObject) CheckLine(line *LineText) bool
type GoStructFields ¶
type GoStructFuncObject ¶
type GoStructFuncObject struct {
DefaultGeneratorObj
}
func NewGoStructFuncObject ¶
func NewGoStructFuncObject(file GeneratorFile) *GoStructFuncObject
func (*GoStructFuncObject) CheckLine ¶
func (this *GoStructFuncObject) CheckLine(line *LineText) bool
type GoStructObject ¶
type GoStructObject struct { DefaultGeneratorObj TagId BINARY_TAG Fields []*GoStructFields Package string StructName string ISerializable bool IComponent bool // contains filtered or unexported fields }
func NewGoStructObject ¶
func NewGoStructObject(file GeneratorFile) *GoStructObject
func (*GoStructObject) CheckLine ¶
func (this *GoStructObject) CheckLine(line *LineText) bool
func (*GoStructObject) IsModel ¶
func (this *GoStructObject) IsModel() bool
func (*GoStructObject) SetPackage ¶
func (this *GoStructObject) SetPackage(pack string)
type GoVarObject ¶
type GoVarObject struct {
DefaultGeneratorObj
}
func NewGoVarObject ¶
func NewGoVarObject(file GeneratorFile) *GoVarObject
func (*GoVarObject) CheckLine ¶
func (this *GoVarObject) CheckLine(line *LineText) bool
type HandShake ¶
type HandShake struct {
Data []byte
}
func (*HandShake) GetId ¶
func (this *HandShake) GetId() (BINARY_TAG, error)
func (*HandShake) Serializable ¶
func (this *HandShake) Serializable() ISerializable
type ISerializable ¶
type ISerializable interface { GetId() (BINARY_TAG, error) Serializable() ISerializable }
type JsonEnumFields ¶
type JsonMsg ¶
type JsonMsg struct { EnumValues JsonEnumFields `json:"values,omitempty"` Fields JsonMsgFields `json:"fields,omitempty"` }
type JsonMsgField ¶
type JsonMsgFields ¶
type JsonMsgFields map[string]JsonMsgField
type JsonSchema ¶
type LineText ¶
type LineText struct { Obj GeneratorObject LineNum int Text string LineType LineType PackageName string StructName string Name string TagName string Value int Type string }
func (*LineText) GetPkgName ¶
func (*LineText) GetStructName ¶
func (*LineText) GetTagName ¶
func (*LineText) GetTypeName ¶
func (*LineText) IsLongStringTag ¶
type LineType ¶
type LineType int
const ( LINE_UNDEFINED LineType = iota LINE_COMMENT LINE_COMMENT_START LINE_COMMENT_END LINE_ANY LINE_EMPTY LINE_GO_PACKAGE LINE_GO_IMPORT_HEADER LINE_GO_IMPORT_BODY LINE_GO_IMPORT_SINGLELINE LINE_GO_INTERFACE_HEADER LINE_GO_PUBLIC_STRUCT_HEADER LINE_GO_PRIVATE_STRUCT_HEADER LINE_GO_STRUCT_FIELD_INHERIT LINE_GO_STRUCT_FIELD_PUBLIC LINE_GO_STRUCT_FIELD_PRIVATE LINE_GO_FUNC_HEADER LINE_GO_INIT_FUNC_HEADER LINE_GO_STRUCT_FUNC_HEADER LINE_GO_DEFINER LINE_GO_ENUM_DEFINER LINE_GO_CONST LINE_GO_VARIABLE LINE_GO_TAG_DEFINER LINE_GO_TAG_REGISTRY LINE_GO_CONST_CLOSURE_START LINE_GO_VAR_CLOSURE_START LINE_GO_ENUM_VARIABLE_IOTA LINE_GO_ENUM_VARIABLE LINE_GO_ENUM_AUTO LINE_CONF_TAG LINE_CONF_PACKAGE LINE_CONF_OFFSET LINE_CONF_RECUR LINE_BRACKET_END LINE_CLOSURE_END LINE_TS_IMPORT_SINGLELINE LINE_TS_IMPORT_CLOSURE_START LINE_TS_IMPORT_CLOSURE_END LINE_TS_IMPORT_OBJ LINE_TS_ENUM_CLOSURE_START LINE_TS_ENUM_OBJ LINE_TS_CLASS_DECORATOR LINE_TS_CLASS_HEADER LINE_TS_CLASS_CONSTRUCTOR_HEADER LINE_TS_CLASS_FIELD_PUBLIC LINE_TS_CLASS_FIELD_PRIVATE LINE_TS_CLASS_GETTER_HEADER LINE_TS_CLASS_SETTER_HEADER LINE_TS_CLASS_FUNC_HEADER LINE_TS_CLASS_FUNC_END LINE_TS_FUNC_HEADER LINE_TS_VAR_SINGLELINE LINE_TS_VAR_CLOSURE_START LINE_TS_VAR_ARRAY_START LINE_TS_ARRAY_END LINE_TS_DEFINE_SINGLELINE LINE_TS_DEFINE_START LINE_TS_DEFINE_OBJ LINE_TS_DEFINE_END LINE_TS_INIT_FUNC_HEADER LINE_TS_INIT_FUNC_END LINE_TS_ID_REG LINE_TS_PROTO_ID_REG LINE_MODEL_PACKAGE LINE_MODEL_GOPACKAGE LINE_MODEL_CSPACKAGE LINE_MODEL_TSPACKAGE LINE_MODEL_IMPORTS LINE_MODEL_IDS_HEADER LINE_MODEL_ID LINE_MODEL_CLASS_HEADER LINE_MODEL_CLASS_FIELD LINE_MODEL_ENUM_HEADER LINE_MODEL_ENUM_FIELD LINE_PROTO_PACKAGE LINE_PROTO_HEADER LINE_PROTO_FIELD LINE_PROTO_ENUM_HEADER LINE_PROTO_ENUM_FIELD LINE_PROTO_ENUM_ALIAS LINE_PROTO_SYNTAX LINE_PROTO_ID )
func (LineType) RegReplaceName ¶
func (LineType) RegReplacePkg ¶
func (LineType) RegReplaceStructName ¶
func (LineType) RegReplaceTagName ¶
func (LineType) RegReplaceType ¶
func (LineType) RegReplaceValue ¶
type ModelClassFields ¶
func (*ModelClassFields) CsString ¶
func (this *ModelClassFields) CsString() string
func (*ModelClassFields) GoString ¶
func (this *ModelClassFields) GoString() string
func (*ModelClassFields) ParamAssignString ¶
func (this *ModelClassFields) ParamAssignString() string
func (*ModelClassFields) ParamString ¶
func (this *ModelClassFields) ParamString() string
type ModelClassObject ¶
type ModelClassObject struct { DefaultGeneratorObj TagId BINARY_TAG Fields []*ModelClassFields Package string CsPackage string GoPackage string TsPackage string ClassName string // contains filtered or unexported fields }
func NewModelClassObject ¶
func NewModelClassObject(file GeneratorFile) *ModelClassObject
func (*ModelClassObject) CheckLine ¶
func (this *ModelClassObject) CheckLine(line *LineText) bool
func (*ModelClassObject) CsString ¶
func (this *ModelClassObject) CsString() string
func (*ModelClassObject) GoImplString ¶
func (this *ModelClassObject) GoImplString() string
func (*ModelClassObject) GoString ¶
func (this *ModelClassObject) GoString() string
func (*ModelClassObject) SetPackage ¶
func (this *ModelClassObject) SetPackage(pack string)
type ModelEnumObject ¶
type ModelEnumObject struct { DefaultGeneratorObj Package string CsPackage string GoPackage string TsPackage string EnumName string // contains filtered or unexported fields }
func NewModelEnumObject ¶
func NewModelEnumObject(file GeneratorFile) *ModelEnumObject
func (*ModelEnumObject) CheckLine ¶
func (this *ModelEnumObject) CheckLine(line *LineText) bool
func (*ModelEnumObject) CsString ¶
func (this *ModelEnumObject) CsString() string
func (*ModelEnumObject) GoString ¶
func (this *ModelEnumObject) GoString() string
func (*ModelEnumObject) SetPackage ¶
func (this *ModelEnumObject) SetPackage(pack string)
type ModelFile ¶
type ModelFile struct { *DefaultGeneratorFile Package string GoPackage string CsPackage string TsPackage string }
func NewModelFile ¶
func (*ModelFile) ProcessEnums ¶
func (this *ModelFile) ProcessEnums() []*ModelEnumObject
func (*ModelFile) ProcessIds ¶
func (*ModelFile) ProcessModels ¶
func (this *ModelFile) ProcessModels() []*ModelClassObject
func (*ModelFile) ProcessPackages ¶
func (this *ModelFile) ProcessPackages() *ModelPackageObject
type ModelId ¶
type ModelId struct { Name string Id int Type string Resp string PackageName string ClassObj *ModelClassObject RespClassObj *ModelClassObject }
func (*ModelId) GetCsIdRegisterString ¶
func (*ModelId) GetCsMessageRegisterString ¶
func (*ModelId) GetCsProtocolFuncString ¶
func (*ModelId) GetGoIdAssignString ¶
func (*ModelId) GetGoIdRegisterString ¶
func (*ModelId) GetGoProtocolFuncString ¶
type ModelIdsObject ¶
type ModelIdsObject struct { DefaultGeneratorObj PackageName string Ids map[int]*ModelId // contains filtered or unexported fields }
func NewModelIdsObject ¶
func NewModelIdsObject(file GeneratorFile) *ModelIdsObject
func (*ModelIdsObject) CheckLine ¶
func (this *ModelIdsObject) CheckLine(line *LineText) bool
type ModelImportObject ¶
type ModelImportObject struct { DefaultGeneratorObj // contains filtered or unexported fields }
func NewModelImportObject ¶
func NewModelImportObject(file GeneratorFile) *ModelImportObject
func (*ModelImportObject) CheckLine ¶
func (this *ModelImportObject) CheckLine(line *LineText) bool
type ModelPackageObject ¶
type ModelPackageObject struct { DefaultGeneratorObj PackageName string GoPackageName string CsPackageName string TsPackageName string Ids map[BINARY_TAG]*ModelId }
func NewModelPackageObject ¶
func NewModelPackageObject(file GeneratorFile) *ModelPackageObject
func (*ModelPackageObject) CheckLine ¶
func (this *ModelPackageObject) CheckLine(line *LineText) bool
func (*ModelPackageObject) CsString ¶
func (this *ModelPackageObject) CsString() string
func (*ModelPackageObject) GetCsFuncString ¶
func (this *ModelPackageObject) GetCsFuncString() string
func (*ModelPackageObject) GetCsIdRegString ¶
func (this *ModelPackageObject) GetCsIdRegString() string
func (*ModelPackageObject) GetCsMessageRegString ¶
func (this *ModelPackageObject) GetCsMessageRegString() string
func (*ModelPackageObject) GetCsPackageName ¶
func (this *ModelPackageObject) GetCsPackageName() string
func (*ModelPackageObject) GetGoFuncString ¶
func (this *ModelPackageObject) GetGoFuncString() string
func (*ModelPackageObject) GetGoIdAssignString ¶
func (this *ModelPackageObject) GetGoIdAssignString() string
func (*ModelPackageObject) GetGoIdRegString ¶
func (this *ModelPackageObject) GetGoIdRegString() string
func (*ModelPackageObject) GetGoPackageName ¶
func (this *ModelPackageObject) GetGoPackageName() string
type ModelSchema ¶
type ModelSchema struct { Index int Name string Path string EnumName string Component bool IsLongString bool Type BINARY_TAG ContainerType BINARY_TAG KeyType BINARY_TAG Body []*ModelSchema Depends []string // contains filtered or unexported fields }
func (*ModelSchema) SetGoRelativePath ¶
func (this *ModelSchema) SetGoRelativePath(goPath string)
func (*ModelSchema) ToJsonSchema ¶
func (this *ModelSchema) ToJsonSchema() string
func (*ModelSchema) ToLineEnd ¶
func (this *ModelSchema) ToLineEnd() string
func (*ModelSchema) ToLineObject ¶
func (this *ModelSchema) ToLineObject() []string
func (*ModelSchema) ToLineStart ¶
func (this *ModelSchema) ToLineStart() string
func (*ModelSchema) ToSingleLine ¶
func (this *ModelSchema) ToSingleLine() string
func (*ModelSchema) ToTsClassHeader ¶
func (this *ModelSchema) ToTsClassHeader() string
func (*ModelSchema) ToTsPublicSingleLine ¶
func (this *ModelSchema) ToTsPublicSingleLine() string
func (*ModelSchema) ToTsPublicType ¶
func (this *ModelSchema) ToTsPublicType() string
type ObjectId ¶
type ObjectId struct {
// contains filtered or unexported fields
}
A globally unique identifier for Objects.
type ObjectType ¶
type ObjectType int
const ( OBJ_UNDEFINED ObjectType = iota OBJ_GO_PACKAGE OBJ_GO_IMPORTS OBJ_GO_INTERFACE OBJ_GO_STRUCT OBJ_GO_STRUCT_FUNC OBJ_GO_FUNC OBJ_GO_VAR OBJ_GO_ENUM OBJ_GO_ID OBJ_GO_ID_REG OBJ_GO_DEFINE OBJ_CONF OBJ_EMPTY OBJ_COMMENT OBJ_TS_CLASS OBJ_TS_IMPORTS OBJ_TS_VAR OBJ_TS_FUNC OBJ_TS_ENUM OBJ_TS_IDS OBJ_MODEL_PACKAGE OBJ_MODEL_IMPORTS OBJ_MODEL_IDS OBJ_MODEL_CLASS OBJ_MODEL_ENUM OBJ_PROTO_PACKAGE OBJ_PROTO_SYNTAX OBJ_PROTO_MSG OBJ_PROTO_IDS OBJ_PROTO_ENUM OBJ_PROTO_TS_INTERFACE )
func (ObjectType) Create ¶
func (this ObjectType) Create(file GeneratorFile) GeneratorObject
func (ObjectType) String ¶
func (this ObjectType) String() string
type Ping ¶
func (*Ping) GetId ¶
func (this *Ping) GetId() (BINARY_TAG, error)
func (*Ping) Serializable ¶
func (this *Ping) Serializable() ISerializable
type Pong ¶
func (*Pong) GetId ¶
func (this *Pong) GetId() (BINARY_TAG, error)
func (*Pong) Serializable ¶
func (this *Pong) Serializable() ISerializable
type ProtoEnumObject ¶
type ProtoEnumObject struct { DefaultGeneratorObj Alias bool Fields []*ProtoField }
func NewProtoEnumObject ¶
func NewProtoEnumObject(file GeneratorFile) *ProtoEnumObject
func (*ProtoEnumObject) CheckField ¶
func (this *ProtoEnumObject) CheckField(line *LineText)
func (*ProtoEnumObject) CheckLine ¶
func (this *ProtoEnumObject) CheckLine(line *LineText) bool
type ProtoField ¶
type ProtoFile ¶
type ProtoFile struct {
*DefaultGeneratorFile
}
func NewProtoFile ¶
func (*ProtoFile) ProcessProtos ¶
func (this *ProtoFile) ProcessProtos() []*ProtoMsgObject
type ProtoIdsFile ¶
type ProtoIdsFile struct { *DefaultGeneratorFile Ids map[int]string }
func NewProtoIdsFile ¶
func NewProtoIdsFile(generator *Generator) *ProtoIdsFile
func (*ProtoIdsFile) AddId ¶
func (this *ProtoIdsFile) AddId(s string, id int)
func (*ProtoIdsFile) Generate ¶
func (this *ProtoIdsFile) Generate() *promise.Promise
func (*ProtoIdsFile) Parse ¶
func (this *ProtoIdsFile) Parse() *promise.Promise
type ProtoIdsObj ¶
type ProtoIdsObj struct { DefaultGeneratorObj ProtoName string Id int }
func NewProtoIdsObj ¶
func NewProtoIdsObj(file GeneratorFile) *ProtoIdsObj
func (*ProtoIdsObj) Check ¶
func (this *ProtoIdsObj) Check(line *LineText)
func (*ProtoIdsObj) CheckLine ¶
func (this *ProtoIdsObj) CheckLine(line *LineText) bool
type ProtoMsgObject ¶
type ProtoMsgObject struct { DefaultGeneratorObj ProtoName string ProtoId int Fields []*ProtoField }
func NewProtoMsgObject ¶
func NewProtoMsgObject(file GeneratorFile) *ProtoMsgObject
func (*ProtoMsgObject) CheckField ¶
func (this *ProtoMsgObject) CheckField(line *LineText)
func (*ProtoMsgObject) CheckLine ¶
func (this *ProtoMsgObject) CheckLine(line *LineText) bool
type ProtoPackageObj ¶
type ProtoPackageObj struct {
DefaultGeneratorObj
}
func NewProtoPackageObj ¶
func NewProtoPackageObj(file GeneratorFile) *ProtoPackageObj
func (*ProtoPackageObj) CheckLine ¶
func (this *ProtoPackageObj) CheckLine(line *LineText) bool
type ProtoSyntaxObj ¶
type ProtoSyntaxObj struct {
DefaultGeneratorObj
}
func NewProtoSyntaxObj ¶
func NewProtoSyntaxObj(file GeneratorFile) *ProtoSyntaxObj
func (*ProtoSyntaxObj) CheckLine ¶
func (this *ProtoSyntaxObj) CheckLine(line *LineText) bool
type RouteMessage ¶
type RouteMessage struct { TransId uint32 Len uint16 Req bool CmdId BINARY_TAG InnerId BINARY_TAG FromActor util.ID ToActor util.ID Body ISerializable }
RouteMessage rpc message across server
func NewRouteMessage ¶
func NewRouteMessage(fromActor util.ID, toActor util.ID, transId uint32, msg ISerializable, isReq bool) *RouteMessage
func (*RouteMessage) BinaryMessage ¶
func (this *RouteMessage) BinaryMessage() *BinaryMessage
func (*RouteMessage) GetId ¶
func (this *RouteMessage) GetId() (BINARY_TAG, error)
func (*RouteMessage) Marshal ¶
func (this *RouteMessage) Marshal() ([]byte, error)
func (*RouteMessage) Serializable ¶
func (this *RouteMessage) Serializable() ISerializable
func (*RouteMessage) Unmarshal ¶
func (this *RouteMessage) Unmarshal(from []byte) error
type TomlSchema ¶
type TomlSchema struct { }
type TsClassMember ¶
type TsClassObject ¶
type TsClassObject struct { DefaultGeneratorObj ClassName string IsComponent bool IsSerializable bool LongStringTag map[string]bool // contains filtered or unexported fields }
func NewTsClassObject ¶
func NewTsClassObject(file GeneratorFile) *TsClassObject
func (*TsClassObject) CheckLine ¶
func (this *TsClassObject) CheckLine(line *LineText) bool
func (*TsClassObject) CheckLongString ¶
func (this *TsClassObject) CheckLongString(mName string) bool
func (*TsClassObject) GetClassMember ¶
func (this *TsClassObject) GetClassMember(s string) *TsClassMember
func (*TsClassObject) GetClassName ¶
func (this *TsClassObject) GetClassName() string
func (*TsClassObject) IsModel ¶
func (this *TsClassObject) IsModel() bool
func (*TsClassObject) Name ¶
func (this *TsClassObject) Name() string
type TsEnumFile ¶
type TsEnumFile struct {
*DefaultGeneratorFile
}
func NewTsEnumFile ¶
func NewTsEnumFile(generator *Generator) *TsEnumFile
func (*TsEnumFile) Generate ¶
func (this *TsEnumFile) Generate() *promise.Promise
func (*TsEnumFile) Parse ¶
func (this *TsEnumFile) Parse() *promise.Promise
type TsEnumObject ¶
type TsEnumObject struct {
DefaultGeneratorObj
}
func NewTsEnumObject ¶
func NewTsEnumObject(file GeneratorFile) *TsEnumObject
func (*TsEnumObject) CheckLine ¶
func (this *TsEnumObject) CheckLine(line *LineText) bool
type TsFuncObject ¶
type TsFuncObject struct {
DefaultGeneratorObj
}
func NewTsFuncObject ¶
func NewTsFuncObject(file GeneratorFile) *TsFuncObject
func (*TsFuncObject) CheckLine ¶
func (this *TsFuncObject) CheckLine(line *LineText) bool
type TsIdsObject ¶
type TsIdsObject struct {
DefaultGeneratorObj
}
func NewTsIdsObject ¶
func NewTsIdsObject(file GeneratorFile) *TsIdsObject
func (*TsIdsObject) CheckLine ¶
func (this *TsIdsObject) CheckLine(line *LineText) bool
type TsImportObject ¶
type TsImportObject struct {
DefaultGeneratorObj
}
func NewTsImportObject ¶
func NewTsImportObject(file GeneratorFile) *TsImportObject
func (*TsImportObject) CheckLine ¶
func (this *TsImportObject) CheckLine(line *LineText) bool
type TsModelFile ¶
type TsModelFile struct {
*DefaultGeneratorFile
}
func NewTsModelFile ¶
func NewTsModelFile(generator *Generator) *TsModelFile
func (*TsModelFile) Generate ¶
func (this *TsModelFile) Generate() *promise.Promise
func (*TsModelFile) Parse ¶
func (this *TsModelFile) Parse() *promise.Promise
func (*TsModelFile) ProcessClasses ¶
func (this *TsModelFile) ProcessClasses() []*TsClassObject
type TsVarObject ¶
type TsVarObject struct {
DefaultGeneratorObj
}
func NewTsVarObject ¶
func NewTsVarObject(file GeneratorFile) *TsVarObject
func (*TsVarObject) CheckLine ¶
func (this *TsVarObject) CheckLine(line *LineText) bool
type TypeRegistry ¶
type TypeRegistry struct {
// contains filtered or unexported fields
}
func (*TypeRegistry) GetInterfaceByTag ¶
func (this *TypeRegistry) GetInterfaceByTag(t BINARY_TAG) (ISerializable, error)
func (*TypeRegistry) GetNameByType ¶
func (this *TypeRegistry) GetNameByType(t reflect.Type) string
func (*TypeRegistry) GetTagByName ¶
func (this *TypeRegistry) GetTagByName(s string) BINARY_TAG
func (*TypeRegistry) GetTagByType ¶
func (this *TypeRegistry) GetTagByType(p reflect.Type) (BINARY_TAG, error)
func (*TypeRegistry) GetTagName ¶
func (this *TypeRegistry) GetTagName(t BINARY_TAG) string
func (*TypeRegistry) GetTypeByTag ¶
func (this *TypeRegistry) GetTypeByTag(t BINARY_TAG) (reflect.Type, error)
func (*TypeRegistry) RegistrySystemTag ¶
func (this *TypeRegistry) RegistrySystemTag(t BINARY_TAG, s string)
func (*TypeRegistry) RegistryTemplateTag ¶
func (this *TypeRegistry) RegistryTemplateTag(t BINARY_TAG, s string)
func (*TypeRegistry) RegistryType ¶
func (this *TypeRegistry) RegistryType(t BINARY_TAG, p reflect.Type)
Source Files ¶
- decode.go
- encode.go
- errors.go
- generator.go
- generator_file.go
- generator_line.go
- generator_obj.go
- global.go
- objectid.go
- parser_conf.go
- parser_go.go
- parser_go_ids.go
- parser_model.go
- parser_proto.go
- parser_proto_ids.go
- parser_tag.go
- parser_ts.go
- parser_ts_enum.go
- parser_ts_ids.go
- protocol.go
- schema_json.go
- schema_model.go
- schema_toml.go
- tag.go
- type.go
Click to show internal directories.
Click to hide internal directories.