Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsannm committed Aug 10, 2024
1 parent 8fb3aa6 commit e7ffafe
Show file tree
Hide file tree
Showing 28 changed files with 169 additions and 202 deletions.
1 change: 1 addition & 0 deletions contrib/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ require (
golang.org/x/sys v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
3 changes: 1 addition & 2 deletions contrib/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
Expand Down
2 changes: 1 addition & 1 deletion contrib/swagger/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ func setSwaggerParam(p *spec.Parameter, pp desc.ParsedField) *spec.Parameter {
}

// fixPathForSwag converts the ronykit mux format urls to swagger url format.
// e.g. /some/path/:x1 --> /some/path/{x1}
// for example, /some/path/:x1 --> /some/path/{x1}
func fixPathForSwag(path string) string {
sb := strings.Builder{}
for idx, p := range strings.Split(path, "/") {
Expand Down
2 changes: 1 addition & 1 deletion example/ex-02-rest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/goccy/go-reflect v1.2.0 // indirect
github.com/jedib0t/go-pretty/v6 v6.5.9 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/savsgio/gotils v0.0.0-20240704082632-aef3928b8a38 // indirect
Expand Down
3 changes: 1 addition & 2 deletions example/ex-02-rest/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ github.com/jedib0t/go-pretty/v6 v6.5.9/go.mod h1:zbn98qrYlh95FIhwwsbIip0LYpwSG8S
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=
github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM=
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand Down
4 changes: 2 additions & 2 deletions example/ex-03-cluster/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker v24.0.5+incompatible // indirect
Expand All @@ -39,7 +39,7 @@ require (
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/redis/go-redis/v9 v9.5.4 // indirect
github.com/redis/go-redis/v9 v9.6.1 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/savsgio/gotils v0.0.0-20240704082632-aef3928b8a38 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
Expand Down
6 changes: 2 additions & 4 deletions example/ex-03-cluster/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/clubpay/ronykit/contrib v0.17.4 h1:6zXT3LILxN5CV0GdXOgz5Q3TAV0FJOybKB7iO0GVN6w=
github.com/clubpay/ronykit/contrib v0.17.4/go.mod h1:+P/0YcLx/kQ2I2Oqs34GEyVPv96QIqkguA5UoqO+PY4=
github.com/clubpay/ronykit/kit v0.17.4 h1:5x6NjKPxi0YlUYBDuAtG2+DhF8e8YMp3vE6m8CJ9ffU=
Expand Down Expand Up @@ -119,8 +118,7 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/redis/go-redis/v9 v9.5.4 h1:vOFYDKKVgrI5u++QvnMT7DksSMYg7Aw/Np4vLJLKLwY=
github.com/redis/go-redis/v9 v9.5.4/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw=
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
Expand Down
42 changes: 23 additions & 19 deletions kit/desc/contract.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package desc

import "github.com/clubpay/ronykit/kit"
import (
"github.com/clubpay/ronykit/kit"
"github.com/clubpay/ronykit/kit/utils"
)

type Header struct {
Name string
Expand Down Expand Up @@ -125,6 +128,7 @@ func (c *Contract) AddError(err kit.ErrorMessage) *Contract {
return c
}

// AddRoute adds a kit.RouteSelector for this contract.
func (c *Contract) AddRoute(r ...RouteSelector) *Contract {
c.RouteSelectors = append(c.RouteSelectors, r...)

Expand All @@ -134,42 +138,42 @@ func (c *Contract) AddRoute(r ...RouteSelector) *Contract {
// AddSelector adds a kit.RouteSelector for this contract. Selectors are bundle-specific.
// Deprecated: use AddRoute instead
func (c *Contract) AddSelector(s ...kit.RouteSelector) *Contract {
return c.Selector(s...)
return c.AddRoute(
utils.Map(
func(src kit.RouteSelector) RouteSelector {
return Route("", src)
}, s,
)...,
)
}

// Selector is an alias for AddSelector
// Deprecated: use AddRoute instead
func (c *Contract) Selector(s ...kit.RouteSelector) *Contract {
for idx := range s {
c.RouteSelectors = append(
c.RouteSelectors,
RouteSelector{Name: "", Selector: s[idx]},
)
}

return c
return c.AddRoute(
utils.Map(
func(src kit.RouteSelector) RouteSelector {
return Route("", src)
}, s,
)...,
)
}

// AddNamedSelector adds a kit.RouteSelector for this contract, and assigns it a unique name.
// AddNamedSelector adds a kit.RouteSelector for this contract and assigns it a unique name.
// In case you need to use auto-generated stub.Stub for your service/contract, this name will
// be used in the generated code.
// Deprecated: use AddRoute instead
func (c *Contract) AddNamedSelector(name string, s kit.RouteSelector) *Contract {
return c.NamedSelector(name, s)
return c.AddRoute(Route(name, s))
}

// NamedSelector is an alias for AddNamedSelector
// Deprecated: use AddRoute instead
func (c *Contract) NamedSelector(name string, s kit.RouteSelector) *Contract {
c.RouteSelectors = append(c.RouteSelectors, RouteSelector{
Name: name,
Selector: s,
})

return c
return c.AddRoute(Route(name, s))
}

// SetCoordinator sets a kit.EdgeSelectorFunc for this contract, to coordinate requests to
// SetCoordinator sets a kit.EdgeSelectorFunc for this contract to coordinate requests to
// right kit.EdgeServer instance.
func (c *Contract) SetCoordinator(f kit.EdgeSelectorFunc) *Contract {
c.EdgeSelector = f
Expand Down
1 change: 1 addition & 0 deletions kit/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ require (
golang.org/x/sys v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
2 changes: 1 addition & 1 deletion kit/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
Expand Down
4 changes: 4 additions & 0 deletions kit/utils/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ func TimeUnix() int64 {
return atomic.LoadInt64(&timeInSec)
}

func TimeUnixAdd(unixTime int64, d time.Duration) int64 {
return int64(time.Duration(unixTime) + d/time.Second)
}

func TimeUnixSubtract(unixTime int64, d time.Duration) int64 {
return int64(time.Duration(unixTime) - d/time.Second)
}
Expand Down
4 changes: 2 additions & 2 deletions rony/setup_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func registerStream[IN, OUT Message, S State[A], A Action](

cfg := stream.GenConfig(opt...)
for _, s := range cfg.Selectors {
c.NamedSelector(s.Name, s.Selector)
c.AddRoute(desc.Route(s.Name, s.Selector))
}

setupCtx.cfg.getService(setupCtx.name).AddContract(c)
Expand All @@ -70,7 +70,7 @@ func registerStream[IN, OUT Message, S State[A], A Action](
StreamOption
*/

// RPC is a StreamOption to set up RPC handler.
// RPC is a StreamOption to set up an RPC handler.
func RPC(predicate string, opt ...StreamSelectorOption) StreamOption {
return func(cfg *stream.Config) {
sCfg := stream.GenSelectorConfig(opt...)
Expand Down
2 changes: 1 addition & 1 deletion rony/setup_unary.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func registerUnary[IN, OUT Message, S State[A], A Action](

cfg := unary.GenConfig(opt...)
for _, s := range cfg.Selectors {
c.NamedSelector(s.Name, s.Selector)
c.AddRoute(desc.Route(s.Name, s.Selector))
}

setupCtx.cfg.getService(setupCtx.name).AddContract(c)
Expand Down
40 changes: 21 additions & 19 deletions std/clusters/p2pcluster/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ go 1.21

require (
github.com/clubpay/ronykit/kit v0.17.5
github.com/libp2p/go-libp2p v0.35.4
github.com/libp2p/go-libp2p v0.36.1
github.com/libp2p/go-libp2p-pubsub v0.11.0
)

require (
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/elastic/gosigar v0.14.2 // indirect
github.com/elastic/gosigar v0.14.3 // indirect
github.com/flynn/noise v1.1.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
Expand All @@ -38,7 +38,7 @@ require (
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
github.com/jedib0t/go-pretty/v6 v6.5.9 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/koron/go-ssdp v0.0.4 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
Expand All @@ -52,53 +52,55 @@ require (
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/miekg/dns v1.1.58 // indirect
github.com/miekg/dns v1.1.61 // indirect
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multiaddr v0.12.4 // indirect
github.com/multiformats/go-multiaddr v0.13.0 // indirect
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
github.com/multiformats/go-multibase v0.2.0 // indirect
github.com/multiformats/go-multicodec v0.9.0 // indirect
github.com/multiformats/go-multihash v0.2.3 // indirect
github.com/multiformats/go-multistream v0.5.0 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/ginkgo/v2 v2.20.0 // indirect
github.com/opencontainers/runtime-spec v1.2.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pion/datachannel v1.5.6 // indirect
github.com/pion/dtls/v2 v2.2.11 // indirect
github.com/pion/ice/v2 v2.3.25 // indirect
github.com/pion/datachannel v1.5.8 // indirect
github.com/pion/dtls/v2 v2.2.12 // indirect
github.com/pion/ice/v2 v2.3.32 // indirect
github.com/pion/interceptor v0.1.29 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/mdns v0.0.12 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/rtcp v1.2.14 // indirect
github.com/pion/rtp v1.8.6 // indirect
github.com/pion/sctp v1.8.16 // indirect
github.com/pion/rtp v1.8.8 // indirect
github.com/pion/sctp v1.8.20 // indirect
github.com/pion/sdp/v3 v3.0.9 // indirect
github.com/pion/srtp/v2 v2.0.18 // indirect
github.com/pion/srtp/v2 v2.0.20 // indirect
github.com/pion/stun v0.6.1 // indirect
github.com/pion/transport/v2 v2.2.5 // indirect
github.com/pion/transport/v2 v2.2.9 // indirect
github.com/pion/turn/v2 v2.1.6 // indirect
github.com/pion/webrtc/v3 v3.2.40 // indirect
github.com/pion/webrtc/v3 v3.2.50 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/quic-go v0.44.0 // indirect
github.com/quic-go/quic-go v0.45.2 // indirect
github.com/quic-go/webtransport-go v0.8.0 // indirect
github.com/raulk/go-watchdog v1.3.0 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/wlynxg/anet v0.0.3 // indirect
go.uber.org/dig v1.17.1 // indirect
go.uber.org/fx v1.22.1 // indirect
go.uber.org/mock v0.4.0 // indirect
Expand All @@ -112,7 +114,7 @@ require (
golang.org/x/sys v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
lukechampine.com/blake3 v1.3.0 // indirect
)
Loading

0 comments on commit e7ffafe

Please sign in to comment.