starpc 0.32.6 → 0.32.7
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 +1 -1
- package/go.sum +2 -2
- package/package.json +1 -1
- package/srpc/message.go +19 -2
package/go.mod
CHANGED
|
@@ -9,7 +9,7 @@ replace github.com/libp2p/go-libp2p => github.com/aperturerobotics/go-libp2p v0.
|
|
|
9
9
|
replace nhooyr.io/websocket => github.com/paralin/nhooyr-websocket v1.8.12-0.20240504231911-2358de657064 // aperture-1
|
|
10
10
|
|
|
11
11
|
require (
|
|
12
|
-
github.com/aperturerobotics/protobuf-go-lite v0.6.
|
|
12
|
+
github.com/aperturerobotics/protobuf-go-lite v0.6.3 // latest
|
|
13
13
|
github.com/aperturerobotics/util v1.23.1 // latest
|
|
14
14
|
)
|
|
15
15
|
|
package/go.sum
CHANGED
|
@@ -2,8 +2,8 @@ github.com/aperturerobotics/go-libp2p v0.33.1-0.20240504075939-591fc65373be h1:P
|
|
|
2
2
|
github.com/aperturerobotics/go-libp2p v0.33.1-0.20240504075939-591fc65373be/go.mod h1:gA6iEEVpQcx0xpygG/U0wkm+DfII4zoPc3EWViXC5b0=
|
|
3
3
|
github.com/aperturerobotics/json-iterator-lite v1.0.0 h1:cihbrYWoK/S2RYXhJLpDZd+GUjVvFJN+D3w1VOqqHRI=
|
|
4
4
|
github.com/aperturerobotics/json-iterator-lite v1.0.0/go.mod h1:snaApCEDtrHHP6UWSLKiYNOZU9A5NyzccKenx9oZEzg=
|
|
5
|
-
github.com/aperturerobotics/protobuf-go-lite v0.6.
|
|
6
|
-
github.com/aperturerobotics/protobuf-go-lite v0.6.
|
|
5
|
+
github.com/aperturerobotics/protobuf-go-lite v0.6.3 h1:AZ821ntYqzCpq6jE5rWJwJLikYbaa63Nka7YfW9EJdE=
|
|
6
|
+
github.com/aperturerobotics/protobuf-go-lite v0.6.3/go.mod h1:YTbfnUj3feSULhs8VgepAHFnF3wUc0CPj4jd2axy21I=
|
|
7
7
|
github.com/aperturerobotics/util v1.23.1 h1:pEeBrN5UUNy83OFyv9d7BQod8O++j5ZwIkEuYGdpRXw=
|
|
8
8
|
github.com/aperturerobotics/util v1.23.1/go.mod h1:dO8P8Ut5xNPpLrPPpn7kM/aJL+qT20C5Ppcs1GE0VNg=
|
|
9
9
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
package/package.json
CHANGED
package/srpc/message.go
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
package srpc
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import (
|
|
4
|
+
"errors"
|
|
5
|
+
|
|
6
|
+
protobuf_go_lite "github.com/aperturerobotics/protobuf-go-lite"
|
|
7
|
+
)
|
|
4
8
|
|
|
5
9
|
// Message is the vtprotobuf message interface.
|
|
6
|
-
// TODO use VTMessage interface
|
|
7
10
|
type Message = protobuf_go_lite.Message
|
|
8
11
|
|
|
9
12
|
// RawMessage is a raw protobuf message container.
|
|
@@ -68,5 +71,19 @@ func (m *RawMessage) UnmarshalVT(data []byte) error {
|
|
|
68
71
|
return nil
|
|
69
72
|
}
|
|
70
73
|
|
|
74
|
+
// SizeVT returns the size of the message when marshaled.
|
|
75
|
+
func (m *RawMessage) SizeVT() int {
|
|
76
|
+
return len(m.data)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// MarshalToSizedBufferVT marshals to a buffer that already is SizeVT bytes long.
|
|
80
|
+
func (m *RawMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
|
81
|
+
if len(dAtA) != len(m.data) {
|
|
82
|
+
return 0, errors.New("invalid buffer length")
|
|
83
|
+
}
|
|
84
|
+
copy(dAtA, m.data)
|
|
85
|
+
return len(dAtA), nil
|
|
86
|
+
}
|
|
87
|
+
|
|
71
88
|
// _ is a type assertion
|
|
72
89
|
var _ Message = ((*RawMessage)(nil))
|