From acb9ecfc0a138c03cb2f2db8d3ea9fab3344f994 Mon Sep 17 00:00:00 2001 From: Ehsan Noureddin Moosa Date: Thu, 9 May 2024 17:29:38 +0300 Subject: [PATCH] cleanup --- std/gateways/fasthttp/bundle.go | 29 ----------------------------- std/gateways/fastws/gateway.go | 22 ---------------------- testenv/go.sum | 16 ++++++++-------- 3 files changed, 8 insertions(+), 59 deletions(-) diff --git a/std/gateways/fasthttp/bundle.go b/std/gateways/fasthttp/bundle.go index e2244767..2fcf336b 100644 --- a/std/gateways/fasthttp/bundle.go +++ b/std/gateways/fasthttp/bundle.go @@ -313,35 +313,6 @@ func (b *bundle) wsDispatch(ctx *kit.Context, in []byte) (kit.ExecuteArg, error) }, nil } -func (b *bundle) writeFunc(conn kit.Conn, e *kit.Envelope) error { - switch c := conn.(type) { - case *wsConn: - outC := b.rpcOutFactory() - outC.InjectMessage(e.GetMsg()) - outC.SetID(e.GetID()) - e.WalkHdr( - func(key string, val string) bool { - outC.SetHdr(key, val) - - return true - }, - ) - - data, err := outC.Marshal() - if err != nil { - return err - } - - _, err = c.Write(data) - outC.Release() - - return err - - default: - panic("BUG!! incorrect connection") - } -} - func (b *bundle) httpDispatch(ctx *kit.Context, in []byte) (kit.ExecuteArg, error) { //nolint:forcetypeassert conn := ctx.Conn().(*httpConn) diff --git a/std/gateways/fastws/gateway.go b/std/gateways/fastws/gateway.go index 4b912e32..6d205743 100644 --- a/std/gateways/fastws/gateway.go +++ b/std/gateways/fastws/gateway.go @@ -10,7 +10,6 @@ import ( "time" "github.com/clubpay/ronykit/kit" - "github.com/clubpay/ronykit/kit/errors" "github.com/clubpay/ronykit/kit/utils" "github.com/clubpay/ronykit/kit/utils/buf" "github.com/gobwas/ws" @@ -35,27 +34,6 @@ func newGateway(b *bundle) *gateway { return gw } -func (gw *gateway) writeFunc(conn kit.Conn, e *kit.Envelope) error { - outC := gw.b.rpcOutFactory() - outC.InjectMessage(e.GetMsg()) - outC.SetID(e.GetID()) - e.WalkHdr(func(key string, val string) bool { - outC.SetHdr(key, val) - - return true - }) - - data, err := outC.Marshal() - if err != nil { - return errors.Wrap(kit.ErrEncodeOutgoingMessageFailed, err) - } - - _, err = conn.Write(data) - outC.Release() - - return err -} - func (gw *gateway) reactFunc(wsc kit.Conn, payload *buf.Bytes, n int) { gw.b.d.OnMessage(wsc, (*payload.Bytes())[:n]) payload.Release() diff --git a/testenv/go.sum b/testenv/go.sum index 1f6df8a0..ce88af2c 100644 --- a/testenv/go.sum +++ b/testenv/go.sum @@ -76,14 +76,14 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/clubpay/ronykit/kit v0.12.4 h1:lvNuJLGpitUbnPYeu6hTWgem97M+pJFgv0G44RMsbeg= -github.com/clubpay/ronykit/kit v0.12.4/go.mod h1:wx77tsrsMTbXKfc4YMsMNdVQFqCdgWP2jcJYll004Wk= -github.com/clubpay/ronykit/std/clusters/p2pcluster v0.12.4 h1:Q5Yec2lu6KoBxjjqiqSK1Ee+i7BVDSweXyLtlPyZkUU= -github.com/clubpay/ronykit/std/clusters/p2pcluster v0.12.4/go.mod h1:3UGSnmzs+SfFtpJdA9YZL7F/pa8iJMfCHYc7MJcEWgg= -github.com/clubpay/ronykit/std/clusters/rediscluster v0.12.4 h1:Lq51gpeXULPjqWDqODuB3xazTPIu1Rny6v39EoJDnHQ= -github.com/clubpay/ronykit/std/clusters/rediscluster v0.12.4/go.mod h1:77FfF7Q2V9JMN0zxveUMjb1og8WxnZnF4R17CraA7N0= -github.com/clubpay/ronykit/std/gateways/fasthttp v0.12.4 h1:WFCgMTxSA+OD8IniKUYwUwj1xbCPGV0Hb36ztr8XMdA= -github.com/clubpay/ronykit/std/gateways/fasthttp v0.12.4/go.mod h1:AcaPAGzjZU+IqfQ6/ByZqj9DweJdzHGBt7U1lHg/Mxk= +github.com/clubpay/ronykit/kit v0.14.0 h1:HP69+MV6d4EYv8S9bKql4ImNGyZt8v1+TDQj3QsbAec= +github.com/clubpay/ronykit/kit v0.14.0/go.mod h1:wx77tsrsMTbXKfc4YMsMNdVQFqCdgWP2jcJYll004Wk= +github.com/clubpay/ronykit/std/clusters/p2pcluster v0.14.0 h1:3WufQmfozJaWArYoEelBZnxPBc137edgYG67vepZ71A= +github.com/clubpay/ronykit/std/clusters/p2pcluster v0.14.0/go.mod h1:xVUMrEfxOH1JZvKih6LTNxF96KKRKSQJJob5+1BpuPs= +github.com/clubpay/ronykit/std/clusters/rediscluster v0.14.0 h1:RJW1hNSU8Ol/yuiheTOzeHUxF70v7hfPSkhxy43RGQ4= +github.com/clubpay/ronykit/std/clusters/rediscluster v0.14.0/go.mod h1:7GKSQ+ifzQrm3i5UVgI1MEnMJL89zzZhvNYZNnyMvgY= +github.com/clubpay/ronykit/std/gateways/fasthttp v0.14.0 h1:anSVcLfNXdzPQQM7wFkdDzY3uZlC3BAbE+m5BSKVzjM= +github.com/clubpay/ronykit/std/gateways/fasthttp v0.14.0/go.mod h1:YF/8lnNQHDlDpuSIJpXca+RcraUJfqeklf4SnB3VcKk= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=