Skip to content

Commit

Permalink
升级test gen
Browse files Browse the repository at this point in the history
  • Loading branch information
davyxu committed Jun 10, 2021
1 parent d27e5a3 commit 35cbd47
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/reg_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,45 @@
package tests

import (
"github.com/davyxu/cellnet"
"github.com/davyxu/cellnet/codec"
"github.com/davyxu/cellnet/meta"
"reflect"
)

var (
_ cellmeta.Meta
_ codec.CodecRecycler
_ cellcodec.CodecRecycler
_ reflect.Kind
)

func init() {

cellnet.RegisterMessageMeta(&cellmeta.Meta{
Codec: codec.MustGetCodec("protoplus"),
cellmeta.Register(&cellmeta.Meta{
Codec: cellcodec.MustGetByName("protoplus"),
Type: reflect.TypeOf((*MyTypeMini)(nil)).Elem(),
ID: 0,
New: func() interface{} { return &MyTypeMini{} },
})
cellnet.RegisterMessageMeta(&cellmeta.Meta{
Codec: codec.MustGetCodec("protoplus"),
cellmeta.Register(&cellmeta.Meta{
Codec: cellcodec.MustGetByName("protoplus"),
Type: reflect.TypeOf((*MySubType)(nil)).Elem(),
ID: 0,
New: func() interface{} { return &MySubType{} },
})
cellnet.RegisterMessageMeta(&cellmeta.Meta{
Codec: codec.MustGetCodec("protoplus"),
cellmeta.Register(&cellmeta.Meta{
Codec: cellcodec.MustGetByName("protoplus"),
Type: reflect.TypeOf((*MyType)(nil)).Elem(),
ID: 0,
New: func() interface{} { return &MyType{} },
})
cellnet.RegisterMessageMeta(&cellmeta.Meta{
Codec: codec.MustGetCodec("protoplus"),
cellmeta.Register(&cellmeta.Meta{
Codec: cellcodec.MustGetByName("protoplus"),
Type: reflect.TypeOf((*LoginREQ)(nil)).Elem(),
ID: 17076,
New: func() interface{} { return &LoginREQ{} },
})
cellnet.RegisterMessageMeta(&cellmeta.Meta{
Codec: codec.MustGetCodec("protoplus"),
cellmeta.Register(&cellmeta.Meta{
Codec: cellcodec.MustGetByName("protoplus"),
Type: reflect.TypeOf((*LoginACK)(nil)).Elem(),
ID: 44443,
New: func() interface{} { return &LoginACK{} },
Expand Down

0 comments on commit 35cbd47

Please sign in to comment.