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

Function init

peer/sysmsgreg.go:11–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9)
10
11func init() {
12 cellnet.RegisterMessageMeta(&cellnet.MessageMeta{
13 Codec: codec.MustGetCodec("binary"),
14 Type: reflect.TypeOf((*cellnet.SessionAccepted)(nil)).Elem(),
15 ID: int(util.StringHash("cellnet.SessionAccepted")),
16 })
17 cellnet.RegisterMessageMeta(&cellnet.MessageMeta{
18 Codec: codec.MustGetCodec("binary"),
19 Type: reflect.TypeOf((*cellnet.SessionConnected)(nil)).Elem(),
20 ID: int(util.StringHash("cellnet.SessionConnected")),
21 })
22 cellnet.RegisterMessageMeta(&cellnet.MessageMeta{
23 Codec: codec.MustGetCodec("binary"),
24 Type: reflect.TypeOf((*cellnet.SessionConnectError)(nil)).Elem(),
25 ID: int(util.StringHash("cellnet.SessionConnectError")),
26 })
27 cellnet.RegisterMessageMeta(&cellnet.MessageMeta{
28 Codec: codec.MustGetCodec("binary"),
29 Type: reflect.TypeOf((*cellnet.SessionClosed)(nil)).Elem(),
30 ID: int(util.StringHash("cellnet.SessionClosed")),
31 })
32 cellnet.RegisterMessageMeta(&cellnet.MessageMeta{
33 Codec: codec.MustGetCodec("binary"),
34 Type: reflect.TypeOf((*cellnet.SessionCloseNotify)(nil)).Elem(),
35 ID: int(util.StringHash("cellnet.SessionCloseNotify")),
36 })
37 cellnet.RegisterMessageMeta(&cellnet.MessageMeta{
38 Codec: codec.MustGetCodec("binary"),
39 Type: reflect.TypeOf((*cellnet.SessionInit)(nil)).Elem(),
40 ID: int(util.StringHash("cellnet.SessionInit")),
41 })
42}

Callers

nothing calls this directly

Calls 3

RegisterMessageMetaFunction · 0.92
MustGetCodecFunction · 0.92
StringHashFunction · 0.92

Tested by

no test coverage detected