File: diff_ttrpc.pb.go

package info (click to toggle)
containerd 2.1.4~ds2-5
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 21,772 kB
  • sloc: sh: 1,885; makefile: 591
file content (60 lines) | stat: -rw-r--r-- 1,724 bytes parent folder | download
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
// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT.
// source: github.com/containerd/containerd/api/services/diff/v1/diff.proto
package diff

import (
	context "context"
	ttrpc "github.com/containerd/ttrpc"
)

type TTRPCDiffService interface {
	Apply(context.Context, *ApplyRequest) (*ApplyResponse, error)
	Diff(context.Context, *DiffRequest) (*DiffResponse, error)
}

func RegisterTTRPCDiffService(srv *ttrpc.Server, svc TTRPCDiffService) {
	srv.RegisterService("containerd.services.diff.v1.Diff", &ttrpc.ServiceDesc{
		Methods: map[string]ttrpc.Method{
			"Apply": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req ApplyRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.Apply(ctx, &req)
			},
			"Diff": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req DiffRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.Diff(ctx, &req)
			},
		},
	})
}

type ttrpcdiffClient struct {
	client *ttrpc.Client
}

func NewTTRPCDiffClient(client *ttrpc.Client) TTRPCDiffService {
	return &ttrpcdiffClient{
		client: client,
	}
}

func (c *ttrpcdiffClient) Apply(ctx context.Context, req *ApplyRequest) (*ApplyResponse, error) {
	var resp ApplyResponse
	if err := c.client.Call(ctx, "containerd.services.diff.v1.Diff", "Apply", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}

func (c *ttrpcdiffClient) Diff(ctx context.Context, req *DiffRequest) (*DiffResponse, error) {
	var resp DiffResponse
	if err := c.client.Call(ctx, "containerd.services.diff.v1.Diff", "Diff", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}