MCPcopy
hub / github.com/davyxu/cellnet / init

Function init

examples/websocket/main.go:32–38  ·  view source on GitHub ↗

将消息注册到系统

()

Source from the content-addressed store, hash-verified

30
31// 将消息注册到系统
32func init() {
33 cellnet.RegisterMessageMeta(&cellnet.MessageMeta{
34 Codec: codec.MustGetCodec("json"),
35 Type: reflect.TypeOf((*TestEchoACK)(nil)).Elem(),
36 ID: 1234,
37 })
38}
39
40var (
41 flagClient = flag.Bool("client", false, "client mode")

Callers

nothing calls this directly

Calls 2

RegisterMessageMetaFunction · 0.92
MustGetCodecFunction · 0.92

Tested by

no test coverage detected