// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT.
// source: github.com/Microsoft/hcsshim/internal/extendedtask/extendedtask.proto
package extendedtask

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

type ExtendedTaskService interface {
	ComputeProcessorInfo(context.Context, *ComputeProcessorInfoRequest) (*ComputeProcessorInfoResponse, error)
}

func RegisterExtendedTaskService(srv *ttrpc.Server, svc ExtendedTaskService) {
	srv.RegisterService("ExtendedTask", &ttrpc.ServiceDesc{
		Methods: map[string]ttrpc.Method{
			"ComputeProcessorInfo": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
				var req ComputeProcessorInfoRequest
				if err := unmarshal(&req); err != nil {
					return nil, err
				}
				return svc.ComputeProcessorInfo(ctx, &req)
			},
		},
	})
}

type extendedtaskClient struct {
	client *ttrpc.Client
}

func NewExtendedTaskClient(client *ttrpc.Client) ExtendedTaskService {
	return &extendedtaskClient{
		client: client,
	}
}

func (c *extendedtaskClient) ComputeProcessorInfo(ctx context.Context, req *ComputeProcessorInfoRequest) (*ComputeProcessorInfoResponse, error) {
	var resp ComputeProcessorInfoResponse
	if err := c.client.Call(ctx, "ExtendedTask", "ComputeProcessorInfo", req, &resp); err != nil {
		return nil, err
	}
	return &resp, nil
}
