File diff suppressed because it is too large
Load Diff
156
api/runtime/sandbox/v1/sandbox_ttrpc.pb.go
Normal file
156
api/runtime/sandbox/v1/sandbox_ttrpc.pb.go
Normal file
@@ -0,0 +1,156 @@
|
||||
// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT.
|
||||
// source: github.com/containerd/containerd/api/runtime/sandbox/v1/sandbox.proto
|
||||
package sandbox
|
||||
|
||||
import (
|
||||
context "context"
|
||||
ttrpc "github.com/containerd/ttrpc"
|
||||
)
|
||||
|
||||
type SandboxService interface {
|
||||
StartSandbox(context.Context, *StartSandboxRequest) (*StartSandboxResponse, error)
|
||||
StopSandbox(context.Context, *StopSandboxRequest) (*StopSandboxResponse, error)
|
||||
WaitSandbox(context.Context, *WaitSandboxRequest) (*WaitSandboxResponse, error)
|
||||
UpdateSandbox(context.Context, *UpdateSandboxRequest) (*UpdateSandboxResponse, error)
|
||||
PauseSandbox(context.Context, *PauseSandboxRequest) (*PauseSandboxResponse, error)
|
||||
ResumeSandbox(context.Context, *ResumeSandboxRequest) (*ResumeSandboxResponse, error)
|
||||
SandboxStatus(context.Context, *SandboxStatusRequest) (*SandboxStatusResponse, error)
|
||||
PingSandbox(context.Context, *PingRequest) (*PingResponse, error)
|
||||
}
|
||||
|
||||
func RegisterSandboxService(srv *ttrpc.Server, svc SandboxService) {
|
||||
srv.RegisterService("containerd.runtime.sandbox.v1.Sandbox", &ttrpc.ServiceDesc{
|
||||
Methods: map[string]ttrpc.Method{
|
||||
"StartSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||
var req StartSandboxRequest
|
||||
if err := unmarshal(&req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return svc.StartSandbox(ctx, &req)
|
||||
},
|
||||
"StopSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||
var req StopSandboxRequest
|
||||
if err := unmarshal(&req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return svc.StopSandbox(ctx, &req)
|
||||
},
|
||||
"WaitSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||
var req WaitSandboxRequest
|
||||
if err := unmarshal(&req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return svc.WaitSandbox(ctx, &req)
|
||||
},
|
||||
"UpdateSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||
var req UpdateSandboxRequest
|
||||
if err := unmarshal(&req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return svc.UpdateSandbox(ctx, &req)
|
||||
},
|
||||
"PauseSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||
var req PauseSandboxRequest
|
||||
if err := unmarshal(&req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return svc.PauseSandbox(ctx, &req)
|
||||
},
|
||||
"ResumeSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||
var req ResumeSandboxRequest
|
||||
if err := unmarshal(&req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return svc.ResumeSandbox(ctx, &req)
|
||||
},
|
||||
"SandboxStatus": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||
var req SandboxStatusRequest
|
||||
if err := unmarshal(&req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return svc.SandboxStatus(ctx, &req)
|
||||
},
|
||||
"PingSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
|
||||
var req PingRequest
|
||||
if err := unmarshal(&req); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return svc.PingSandbox(ctx, &req)
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
type sandboxClient struct {
|
||||
client *ttrpc.Client
|
||||
}
|
||||
|
||||
func NewSandboxClient(client *ttrpc.Client) SandboxService {
|
||||
return &sandboxClient{
|
||||
client: client,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *sandboxClient) StartSandbox(ctx context.Context, req *StartSandboxRequest) (*StartSandboxResponse, error) {
|
||||
var resp StartSandboxResponse
|
||||
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "StartSandbox", req, &resp); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
func (c *sandboxClient) StopSandbox(ctx context.Context, req *StopSandboxRequest) (*StopSandboxResponse, error) {
|
||||
var resp StopSandboxResponse
|
||||
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "StopSandbox", req, &resp); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
func (c *sandboxClient) WaitSandbox(ctx context.Context, req *WaitSandboxRequest) (*WaitSandboxResponse, error) {
|
||||
var resp WaitSandboxResponse
|
||||
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "WaitSandbox", req, &resp); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
func (c *sandboxClient) UpdateSandbox(ctx context.Context, req *UpdateSandboxRequest) (*UpdateSandboxResponse, error) {
|
||||
var resp UpdateSandboxResponse
|
||||
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "UpdateSandbox", req, &resp); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
func (c *sandboxClient) PauseSandbox(ctx context.Context, req *PauseSandboxRequest) (*PauseSandboxResponse, error) {
|
||||
var resp PauseSandboxResponse
|
||||
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "PauseSandbox", req, &resp); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
func (c *sandboxClient) ResumeSandbox(ctx context.Context, req *ResumeSandboxRequest) (*ResumeSandboxResponse, error) {
|
||||
var resp ResumeSandboxResponse
|
||||
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "ResumeSandbox", req, &resp); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
func (c *sandboxClient) SandboxStatus(ctx context.Context, req *SandboxStatusRequest) (*SandboxStatusResponse, error) {
|
||||
var resp SandboxStatusResponse
|
||||
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "SandboxStatus", req, &resp); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
func (c *sandboxClient) PingSandbox(ctx context.Context, req *PingRequest) (*PingResponse, error) {
|
||||
var resp PingResponse
|
||||
if err := c.client.Call(ctx, "containerd.runtime.sandbox.v1.Sandbox", "PingSandbox", req, &resp); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resp, nil
|
||||
}
|
||||
Reference in New Issue
Block a user