fixture

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgIdPingReq uint32
	MsgIdPingAck
)

a group of message ids

View Source
const (
	MsgIdBroadCastReq uint32
	MsgIdBroadCastAck
)

broadcast messages

View Source
const ServerAddr = "0.0.0.0:8888"

Variables

This section is empty.

Functions

func RecoverMiddleware

func RecoverMiddleware(log *logrus.Logger) easytcp.MiddlewareFunc

Types

type CustomPacker

type CustomPacker struct{}

CustomPacker custom packer payload format: totalSize(4)|typeSize(2)|type(n)|data(n)

| `totalSize` | `typeSize` | `type` | `data` | | ----------- | ---------- | ----------------------- | ------ | | uint32 | uint16 | []byte | []byte | | 4 bytes | 2 bytes | according to `typeSize` | |

func (*CustomPacker) Pack

func (p *CustomPacker) Pack(entry *message.Entry) ([]byte, error)

func (*CustomPacker) Unpack

func (p *CustomPacker) Unpack(reader io.Reader) (*message.Entry, error)

type Json01Req

type Json01Req struct {
	Key1 string `json:"key_1"`
	Key2 int    `json:"key_2"`
	Key3 bool   `json:"key_3"`
}

type Json01Resp

type Json01Resp struct {
	Success bool        `json:"success"`
	Data    interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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