-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathwrap.go
41 lines (32 loc) · 1022 Bytes
/
wrap.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package ydb
import (
"github.com/golang/protobuf/proto"
"github.com/yandex-cloud/ydb-go-sdk/v2/internal"
)
type Operation = internal.Operation
func WrapWithResponse(method string, req proto.Message, resp Response) Operation {
return internal.WrapWithResponse(method, req, resp)
}
func Wrap(method string, req, res proto.Message) Operation {
return internal.Wrap(method, req, res)
}
func Unwrap(op Operation) (method string, req, res proto.Message) {
method, req, res, _ = internal.Unwrap(op)
return method, req, res
}
type StreamOperationResponse = internal.StreamOperationResponse
type StreamOperation = internal.StreamOperation
func WrapStreamOperation(
method string, req proto.Message,
resp StreamOperationResponse,
p func(error),
) StreamOperation {
return internal.WrapStreamOperation(method, req, resp, p)
}
func UnwrapStreamOperation(op StreamOperation) (
method string, req proto.Message,
resp StreamOperationResponse,
processor func(error),
) {
return internal.UnwrapStreamOperation(op)
}