swift

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenSwift

func GenSwift(schemas parser.MTProtoSchemasFixed, outFilePath string)

func GetApi0Tpl

func GetApi0Tpl(tplApi *TplApiInfo, outFilePath string)

func GetApiNTpl

func GetApiNTpl(tplApi *TplApiInfo, outFilePath string)

Types

type TplApiInfo

type TplApiInfo struct {
	ConstructorListBase []string
	FunctionListBase    []string
	BaseTypeList        []*TplBaseTypeData
	RequestList         []*TplMessageData
}

type TplBaseTypeData

type TplBaseTypeData struct {
	Name             string
	Name2            string
	NameSpace        string
	NameSpaceDisplay string
	EnumIndirect     string
	ParamList        []TplParam
	ResType          string
	ResType2         string
	SubMessageList   []*TplMessageData
}

Base类型

type TplCRC32

type TplCRC32 struct {
	CRC32List []*TplCRC32Info
}

type TplCRC32Info

type TplCRC32Info struct {
	Name string
	Type string
}

type TplCodecDataList

type TplCodecDataList struct {
	PackageGo             string
	PackageJava           string
	BaseTypePredicateList []*TplBaseTypeData
	BaseTypeList          []*TplBaseTypeData
	RequestList           []*TplMessageData
	RequestPredicateList  []*TplMessageData
	CRC32List             []*TplCRC32Info
	VectorResList         []TplVector
}

types

type TplFunctionDataList

type TplFunctionDataList struct {
	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 {
	Predicate        string
	Name             string
	NameSpace        string
	NameSpaceDisplay string
	ParamList        []TplParam
	ResType          string
	ResType2         string

	PredicateDatas []*TplPredicateData
}

对应生成proto消息

type TplPackageData

type TplPackageData struct {
	RPCPackage string
	RPCName    string
}

type TplParam

type TplParam struct {
	Type  string
	Name  string
	Name2 string
	Index int
}

参数列表

type TplPredicateData

type TplPredicateData struct {
	Id               int32
	TypeId           string
	Predicate        string
	Layer            string
	Name             string
	ShortName        string
	NameSpace        string
	NameSpaceDisplay string
	Line             string
	ParamList        []TplParam
	ResType          string
	ResType2         string

	ParserParams         []parser.Param
	EncodeCodeList       []string
	DecodeCodeList       []string
	ParamListDisplay     string
	ParamListDeclare     string
	ParamListReturn      string
	ParamListDescription string
}

type TplServiceData

type TplServiceData struct {
	RPCPackage   string
	RPCName      string
	MethodName   string
	RequestName  string
	ResponseName string
	Line         string
}

type TplServiceDataList

type TplServiceDataList struct {
	ServiceList map[string][]*TplServiceData
}

functions

type TplVector

type TplVector struct {
	Name       string
	Type       string
	EncodeCode string
	DecodeCode string
}

Jump to

Keyboard shortcuts

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