starpc 0.22.4 → 0.22.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/go.mod +6 -6
- package/go.sum +8 -8
- package/package.json +5 -9
- package/srpc/invoker.go +15 -0
package/go.mod
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
module github.com/aperturerobotics/starpc
|
|
2
2
|
|
|
3
|
-
go 1.
|
|
3
|
+
go 1.20
|
|
4
4
|
|
|
5
5
|
require (
|
|
6
6
|
github.com/pkg/errors v0.9.1 // latest
|
|
7
7
|
google.golang.org/protobuf v1.32.0 // latest
|
|
8
|
-
nhooyr.io/websocket v1.8.10 //
|
|
8
|
+
nhooyr.io/websocket v1.8.10 // latest
|
|
9
9
|
)
|
|
10
10
|
|
|
11
11
|
require (
|
|
12
|
-
github.com/aperturerobotics/util v1.
|
|
12
|
+
github.com/aperturerobotics/util v1.11.0 // latest
|
|
13
13
|
github.com/libp2p/go-libp2p v0.32.2 // latest
|
|
14
|
-
github.com/libp2p/go-yamux/v4 v4.0.
|
|
14
|
+
github.com/libp2p/go-yamux/v4 v4.0.2-0.20231213140704-4c5812896512 // master
|
|
15
15
|
github.com/sirupsen/logrus v1.9.3 // latest
|
|
16
16
|
)
|
|
17
17
|
|
|
@@ -31,8 +31,8 @@ require (
|
|
|
31
31
|
github.com/multiformats/go-multistream v0.5.0 // indirect
|
|
32
32
|
github.com/multiformats/go-varint v0.0.7 // indirect
|
|
33
33
|
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
|
34
|
-
golang.org/x/crypto v0.
|
|
34
|
+
golang.org/x/crypto v0.17.0 // indirect
|
|
35
35
|
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
|
|
36
|
-
golang.org/x/sys v0.
|
|
36
|
+
golang.org/x/sys v0.15.0 // indirect
|
|
37
37
|
lukechampine.com/blake3 v1.2.1 // indirect
|
|
38
38
|
)
|
package/go.sum
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
github.com/aperturerobotics/util v1.
|
|
2
|
-
github.com/aperturerobotics/util v1.
|
|
1
|
+
github.com/aperturerobotics/util v1.11.0 h1:SpbpNw23DACYkiZ9cCauP98Nwg73T04YkfD4E/WZ2Hc=
|
|
2
|
+
github.com/aperturerobotics/util v1.11.0/go.mod h1:d84OAQAGXCpl7JOBstnal91Lm6nKgk+vBgtHPgxBYrQ=
|
|
3
3
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
4
4
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
5
5
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
@@ -16,8 +16,8 @@ github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QT
|
|
|
16
16
|
github.com/libp2p/go-libp2p v0.32.2 h1:s8GYN4YJzgUoyeYNPdW7JZeZ5Ee31iNaIBfGYMAY4FQ=
|
|
17
17
|
github.com/libp2p/go-libp2p v0.32.2/go.mod h1:E0LKe+diV/ZVJVnOJby8VC5xzHF0660osg71skcxJvk=
|
|
18
18
|
github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA=
|
|
19
|
-
github.com/libp2p/go-yamux/v4 v4.0.
|
|
20
|
-
github.com/libp2p/go-yamux/v4 v4.0.
|
|
19
|
+
github.com/libp2p/go-yamux/v4 v4.0.2-0.20231213140704-4c5812896512 h1:QvLt0Hr2Qmex+9wrv/tBeDsZ5AutKdy6ZF7pGTyEeQY=
|
|
20
|
+
github.com/libp2p/go-yamux/v4 v4.0.2-0.20231213140704-4c5812896512/go.mod h1:OsNeDpmxccy93bUsruLEdsqIuO1VbBOFsQ4c4GfwenE=
|
|
21
21
|
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
|
|
22
22
|
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
|
|
23
23
|
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
|
|
@@ -49,14 +49,14 @@ github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2
|
|
|
49
49
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
|
50
50
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
|
51
51
|
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
|
52
|
-
golang.org/x/crypto v0.
|
|
53
|
-
golang.org/x/crypto v0.
|
|
52
|
+
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
|
|
53
|
+
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
|
54
54
|
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
|
|
55
55
|
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
|
|
56
56
|
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
57
57
|
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
58
|
-
golang.org/x/sys v0.
|
|
59
|
-
golang.org/x/sys v0.
|
|
58
|
+
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
|
59
|
+
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
|
60
60
|
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
|
|
61
61
|
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
|
62
62
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starpc",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.5",
|
|
4
4
|
"description": "Streaming protobuf RPC service protocol over any two-way channel.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -61,18 +61,14 @@
|
|
|
61
61
|
"singleQuote": true
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@aperturerobotics/ts-common": "^0.8.
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^6.15.0",
|
|
66
|
-
"@typescript-eslint/parser": "^6.15.0",
|
|
64
|
+
"@aperturerobotics/ts-common": "^0.8.2",
|
|
67
65
|
"bufferutil": "^4.0.7",
|
|
68
66
|
"depcheck": "^1.4.6",
|
|
69
|
-
"esbuild": "^0.19.
|
|
70
|
-
"eslint": "^8.56.0",
|
|
71
|
-
"eslint-config-prettier": "^9.0.0",
|
|
67
|
+
"esbuild": "^0.19.11",
|
|
72
68
|
"prettier": "^3.0.3",
|
|
73
69
|
"rimraf": "^5.0.1",
|
|
74
70
|
"ts-poet": "6.6.0",
|
|
75
|
-
"ts-proto": "^1.
|
|
71
|
+
"ts-proto": "^1.166.1",
|
|
76
72
|
"typescript": "^5.3.2",
|
|
77
73
|
"utf-8-validate": "^6.0.3"
|
|
78
74
|
},
|
|
@@ -84,7 +80,7 @@
|
|
|
84
80
|
"is-promise": "^4.0.0",
|
|
85
81
|
"isomorphic-ws": "^5.0.0",
|
|
86
82
|
"it-first": "^3.0.3",
|
|
87
|
-
"it-length-prefixed": "^9.0.
|
|
83
|
+
"it-length-prefixed": "^9.0.4",
|
|
88
84
|
"it-pipe": "^3.0.1",
|
|
89
85
|
"it-pushable": "^3.2.3",
|
|
90
86
|
"it-stream-types": "^2.0.1",
|
package/srpc/invoker.go
CHANGED
|
@@ -30,3 +30,18 @@ func (s InvokerSlice) InvokeMethod(serviceID, methodID string, strm Stream) (boo
|
|
|
30
30
|
|
|
31
31
|
// _ is a type assertion
|
|
32
32
|
var _ Invoker = (InvokerSlice)(nil)
|
|
33
|
+
|
|
34
|
+
// InvokerFunc is a function implementing InvokeMethod.
|
|
35
|
+
type InvokerFunc func(serviceID, methodID string, strm Stream) (bool, error)
|
|
36
|
+
|
|
37
|
+
// InvokeMethod invokes the method matching the service & method ID.
|
|
38
|
+
// Returns false, nil if not found.
|
|
39
|
+
// If service string is empty, ignore it.
|
|
40
|
+
func (f InvokerFunc) InvokeMethod(serviceID, methodID string, strm Stream) (bool, error) {
|
|
41
|
+
if f == nil {
|
|
42
|
+
return false, nil
|
|
43
|
+
}
|
|
44
|
+
return f(serviceID, methodID, strm)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var _ Invoker = (InvokerFunc)(nil)
|