-
Notifications
You must be signed in to change notification settings - Fork 3.3k
/
version_ttrpc.pb.go
45 lines (39 loc) · 1.27 KB
/
version_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
// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT.
// source: github.com/containerd/containerd/api/services/version/v1/version.proto
package version
import (
context "context"
ttrpc "github.com/containerd/ttrpc"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
type TTRPCVersionService interface {
Version(context.Context, *emptypb.Empty) (*VersionResponse, error)
}
func RegisterTTRPCVersionService(srv *ttrpc.Server, svc TTRPCVersionService) {
srv.RegisterService("containerd.services.version.v1.Version", &ttrpc.ServiceDesc{
Methods: map[string]ttrpc.Method{
"Version": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
var req emptypb.Empty
if err := unmarshal(&req); err != nil {
return nil, err
}
return svc.Version(ctx, &req)
},
},
})
}
type ttrpcversionClient struct {
client *ttrpc.Client
}
func NewTTRPCVersionClient(client *ttrpc.Client) TTRPCVersionService {
return &ttrpcversionClient{
client: client,
}
}
func (c *ttrpcversionClient) Version(ctx context.Context, req *emptypb.Empty) (*VersionResponse, error) {
var resp VersionResponse
if err := c.client.Call(ctx, "containerd.services.version.v1.Version", "Version", req, &resp); err != nil {
return nil, err
}
return &resp, nil
}