proto

package
v0.0.0-...-65ee0f0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenProto

func GenProto(schemas []parser.MTProtoSchemasFixed, outFilePath, packageName string)

func GetHandshakeProto

func GetHandshakeProto(schemas []parser.MTProtoSchemasFixed, outFilePath, packageName string) (*TplTypesDataList, *TplFunctionDataList)

func GetSyncProto

func GetSyncProto(schemas []parser.MTProtoSchemasFixed, outFilePath, packageName string) (*TplTypesDataList, *TplFunctionDataList)

func GetTransportProto

func GetTransportProto(schemas []parser.MTProtoSchemasFixed, outFilePath, packageName string) (*TplTypesDataList, *TplFunctionDataList)

Types

type TplBaseTypeData

type TplBaseTypeData struct {
	Name      string
	ParamList []TplParam
	// Line string
	ResType string
	// 所有的子类
	SubMessageList []*TplMessageData
}

Base类型

type TplCRC32

type TplCRC32 struct {
	PackageGo       string
	PackageJava     string
	ConstructorList []TplCRC32Info
	RequestList     []TplCRC32Info
}

func GetCRC32Proto

func GetCRC32Proto(schemas []parser.MTProtoSchemasFixed, outFilePath, packageName string) *TplCRC32

type TplCRC32Info

type TplCRC32Info struct {
	Name string
	Id   int32
}

type TplFunctionDataList

type TplFunctionDataList struct {
	PackageGo   string
	PackageJava string
	RequestList []*TplMessageData
	// Vector是非标准proto消息,故要自动生成一个Vector包装proto消息
	// 注意去重
	VectorResList []TplParam
	// RpcList
	// service RPCAuth {
	//	rpc auth_checkPhone(TL_auth_checkPhone) returns (auth_CheckedPhone) {}
	// }
	ServiceList []TplBaseTypeData
}

functions

type TplMessageData

type TplMessageData struct {
	Name string
	// 碰撞的字段名,特殊处理
	ParamList []TplParam
	ResType   string
	Line      string
}

对应生成proto消息

type TplParam

type TplParam struct {
	Type  string
	Name  string
	Index string
}

参数列表

type TplTypesDataList

type TplTypesDataList struct {
	PackageGo    string
	PackageJava  string
	BaseTypeList []TplBaseTypeData
}

types

func GetCoreTypesProto

func GetCoreTypesProto(schemas []parser.MTProtoSchemasFixed, outFilePath, packageName string) *TplTypesDataList

Jump to

Keyboard shortcuts

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