dc

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteMessage

func WriteMessage(client *meim.Client, msg proto.Message)

just for example

Types

type DataCreator

type DataCreator struct {
	// contains filtered or unexported fields
}

func NewDataCreator

func NewDataCreator() *DataCreator

func (*DataCreator) Clone

func (m *DataCreator) Clone() *DataCreator

func (*DataCreator) CreateBody

func (m *DataCreator) CreateBody(cmd int) meim.ProtocolBody

func (*DataCreator) CreateHeader

func (m *DataCreator) CreateHeader() meim.ProtocolHeader

func (*DataCreator) CreateMessage

func (m *DataCreator) CreateMessage(body interface{}) *meim.Message

func (*DataCreator) GetCmd

func (m *DataCreator) GetCmd(body interface{}) (int, bool)

func (*DataCreator) GetCmd2

func (m *DataCreator) GetCmd2(t reflect.Type) (int, bool)

func (*DataCreator) GetDescription

func (m *DataCreator) GetDescription(cmd int) string

func (*DataCreator) GetMsg

func (m *DataCreator) GetMsg(cmd int) interface{}

func (*DataCreator) SetBodyCmd

func (m *DataCreator) SetBodyCmd(cmd int, body interface{}, desc ...string)

func (*DataCreator) SetBodyCmd2

func (m *DataCreator) SetBodyCmd2(cmd int, t reflect.Type, desc ...string)

func (*DataCreator) SetHeaderType

func (m *DataCreator) SetHeaderType(header meim.ProtocolHeader)

func (*DataCreator) SetHeaderType2

func (m *DataCreator) SetHeaderType2(t reflect.Type)

type ProtoData

type ProtoData struct {
	proto.Message
}

proto.Message

func NewProtoData

func NewProtoData(data proto.Message) *ProtoData

func (*ProtoData) Decode

func (p *ProtoData) Decode(b []byte) error

func (*ProtoData) Encode

func (p *ProtoData) Encode() ([]byte, error)

func (*ProtoData) Reset

func (p *ProtoData) Reset()

func (*ProtoData) String

func (p *ProtoData) String() string

type ProtoDataCreator

type ProtoDataCreator struct {
	*DataCreator
}

body 是proto.Message的创造器

func NewProtoDataCreator

func NewProtoDataCreator() *ProtoDataCreator

func (*ProtoDataCreator) Clone

func (m *ProtoDataCreator) Clone() *ProtoDataCreator

func (*ProtoDataCreator) CreateBody

func (m *ProtoDataCreator) CreateBody(cmd int) meim.ProtocolBody

func (*ProtoDataCreator) CreateMessage

func (m *ProtoDataCreator) CreateMessage(body interface{}) *meim.Message

func (*ProtoDataCreator) SetBodyCmd

func (m *ProtoDataCreator) SetBodyCmd(cmd int, body proto.Message, desc ...string)

func (*ProtoDataCreator) SetBodyCmd2

func (m *ProtoDataCreator) SetBodyCmd2(cmd int, t reflect.Type, desc ...string)

必须是proto.Message类型的指针

Jump to

Keyboard shortcuts

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