From 35cbd476cb7ccf9e250abe26c928a3885388bdcd Mon Sep 17 00:00:00 2001 From: davyxu Date: Thu, 10 Jun 2021 09:38:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7test=20gen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/reg_gen.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/reg_gen.go b/tests/reg_gen.go index bb39098..efead79 100644 --- a/tests/reg_gen.go +++ b/tests/reg_gen.go @@ -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{} },