Documentation ¶
Index ¶
- Constants
- Variables
- func JsonStructMarshal(v interface{}) ([]byte, error)
- func JsonStructUnmarshal(d []byte, v interface{}) error
- func OnInit(s core.IService, opt ...Option) (err error)
- func ProtoStructMarshal(v interface{}) ([]byte, error)
- func ProtoStructUnmarshal(d []byte, v interface{}) error
- func ReadByte(r *bufio.Reader) (byte, error)
- func ReadUInt16(r *bufio.Reader) (uint16, error)
- func ReadUInt32(r *bufio.Reader) (uint32, error)
- type IMessage
- type IMsgMarshalString
- type Message
- type Option
- func SetIsUseBigEndian(v bool) Option
- func SetMessageDecodeBybufio(v func(r *bufio.Reader) (IMessage, error)) Option
- func SetMessageDecodeBybytes(v func(buffer []byte) (msg IMessage, err error)) Option
- func SetMsgMarshal(v func(comId uint16, msgId uint16, msg interface{}) IMessage) Option
- func SetProtoType(v ProtoType) Option
- type Options
- type ProtoType
Constants ¶
View Source
const DK_CHECK_NEW = 0x24 //校验类型
Variables ¶
View Source
var ( MsgProtoType ProtoType IsUseBigEndian bool MsgUnMarshal func(t reflect.Type, d []byte) (interface{}, error) MsgMarshal func(comId uint16, msgId uint16, msg interface{}) IMessage StructUnmarshal func(d []byte, v interface{}) error StructMarshal func(v interface{}) ([]byte, error) MsgToString func(v interface{}) string MessageDecodeBybufio func(r *bufio.Reader) (IMessage, error) MessageDecodeBybytes func(buffer []byte) (msg IMessage, err error) )
Functions ¶
func JsonStructMarshal ¶
func JsonStructUnmarshal ¶
func ProtoStructMarshal ¶
func ProtoStructUnmarshal ¶
Types ¶
type IMessage ¶
type IMessage interface { GetComId() uint16 GetMsgId() uint16 GetMsg() []byte Serializable() (bytes []byte, err error) ToString() string }
func DefMessageDecodeBybufio ¶
func DefMessageDecodeBybytes ¶
func DefMessageMarshal ¶
type IMsgMarshalString ¶
type Message ¶
func (*Message) Serializable ¶
type Option ¶
type Option func(*Options)
func SetIsUseBigEndian ¶
func SetMessageDecodeBybufio ¶
func SetMessageDecodeBybytes ¶
func SetMsgMarshal ¶
func SetProtoType ¶
Click to show internal directories.
Click to hide internal directories.