gen_protocol

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gen

func Gen() error

生成协议

Types

type Field

type Field struct {
	Tag            int
	Name           string
	CamelName      string
	Type           field_type
	TypeName       string // 描述文件里的类型
	SpTypeName     string // proto文件的类型
	SpWireTypeName string // go结构体中,tag里的sproto类型
	GoTypeName     string
	Default        interface{}
	IsArray        bool
	CommentArr     []string
	Message        *Message
}

type Message

type Message struct {
	StructName string
	FieldDict  map[string]*Field
	FieldArr   []*Field
}

type MessageType

type MessageType int

func (MessageType) IsNotifyType

func (s MessageType) IsNotifyType() bool

func (MessageType) IsPushType

func (s MessageType) IsPushType() bool

func (MessageType) IsRequestType

func (s MessageType) IsRequestType() bool

func (MessageType) IsSResponseType

func (s MessageType) IsSResponseType() bool

func (MessageType) IsStructType

func (s MessageType) IsStructType() bool

type Packet

type Packet struct {
	MessageId  int
	CommentArr []string
	Name       string
	FullName   string
	StructName string
	Type       MessageType
	Message    *Message
	Request    *Message
	Response   *Message
	Push       *Message
	Notify     *Message
}

type Parser

type Parser interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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