/
ioproxy_ttrpc.pb.go
61 lines (54 loc) · 1.62 KB
/
ioproxy_ttrpc.pb.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT.
// source: ioproxy.proto
package ioproxy
import (
context "context"
ttrpc "github.com/containerd/ttrpc"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
type IOProxyService interface {
State(context.Context, *StateRequest) (*StateResponse, error)
Attach(context.Context, *AttachRequest) (*emptypb.Empty, error)
}
func RegisterIOProxyService(srv *ttrpc.Server, svc IOProxyService) {
srv.RegisterService("IOProxy", &ttrpc.ServiceDesc{
Methods: map[string]ttrpc.Method{
"State": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
var req StateRequest
if err := unmarshal(&req); err != nil {
return nil, err
}
return svc.State(ctx, &req)
},
"Attach": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
var req AttachRequest
if err := unmarshal(&req); err != nil {
return nil, err
}
return svc.Attach(ctx, &req)
},
},
})
}
type ioproxyClient struct {
client *ttrpc.Client
}
func NewIOProxyClient(client *ttrpc.Client) IOProxyService {
return &ioproxyClient{
client: client,
}
}
func (c *ioproxyClient) State(ctx context.Context, req *StateRequest) (*StateResponse, error) {
var resp StateResponse
if err := c.client.Call(ctx, "IOProxy", "State", req, &resp); err != nil {
return nil, err
}
return &resp, nil
}
func (c *ioproxyClient) Attach(ctx context.Context, req *AttachRequest) (*emptypb.Empty, error) {
var resp emptypb.Empty
if err := c.client.Call(ctx, "IOProxy", "Attach", req, &resp); err != nil {
return nil, err
}
return &resp, nil
}