Files
services/function/proto/function.pb.micro.go
Asim Aslam 609c4c9813 functions branch and region support (#330)
* branch and region support

* .

* .

* .

* .

* fix functions

* .

* break loop

* update example

* update examples
2021-12-16 19:23:03 +00:00

231 lines
7.9 KiB
Go

// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: proto/function.proto
package function
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/protobuf/types/known/structpb"
math "math"
)
import (
context "context"
api "github.com/micro/micro/v3/service/api"
client "github.com/micro/micro/v3/service/client"
server "github.com/micro/micro/v3/service/server"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// Reference imports to suppress errors if they are not otherwise used.
var _ api.Endpoint
var _ context.Context
var _ client.Option
var _ server.Option
// Api Endpoints for Function service
func NewFunctionEndpoints() []*api.Endpoint {
return []*api.Endpoint{}
}
// Client API for Function service
type FunctionService interface {
Call(ctx context.Context, in *CallRequest, opts ...client.CallOption) (*CallResponse, error)
Deploy(ctx context.Context, in *DeployRequest, opts ...client.CallOption) (*DeployResponse, error)
List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error)
Describe(ctx context.Context, in *DescribeRequest, opts ...client.CallOption) (*DescribeResponse, error)
Update(ctx context.Context, in *UpdateRequest, opts ...client.CallOption) (*UpdateResponse, error)
Proxy(ctx context.Context, in *ProxyRequest, opts ...client.CallOption) (*ProxyResponse, error)
Regions(ctx context.Context, in *RegionsRequest, opts ...client.CallOption) (*RegionsResponse, error)
Reserve(ctx context.Context, in *ReserveRequest, opts ...client.CallOption) (*ReserveResponse, error)
}
type functionService struct {
c client.Client
name string
}
func NewFunctionService(name string, c client.Client) FunctionService {
return &functionService{
c: c,
name: name,
}
}
func (c *functionService) Call(ctx context.Context, in *CallRequest, opts ...client.CallOption) (*CallResponse, error) {
req := c.c.NewRequest(c.name, "Function.Call", in)
out := new(CallResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *functionService) Deploy(ctx context.Context, in *DeployRequest, opts ...client.CallOption) (*DeployResponse, error) {
req := c.c.NewRequest(c.name, "Function.Deploy", in)
out := new(DeployResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *functionService) List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error) {
req := c.c.NewRequest(c.name, "Function.List", in)
out := new(ListResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *functionService) Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error) {
req := c.c.NewRequest(c.name, "Function.Delete", in)
out := new(DeleteResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *functionService) Describe(ctx context.Context, in *DescribeRequest, opts ...client.CallOption) (*DescribeResponse, error) {
req := c.c.NewRequest(c.name, "Function.Describe", in)
out := new(DescribeResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *functionService) Update(ctx context.Context, in *UpdateRequest, opts ...client.CallOption) (*UpdateResponse, error) {
req := c.c.NewRequest(c.name, "Function.Update", in)
out := new(UpdateResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *functionService) Proxy(ctx context.Context, in *ProxyRequest, opts ...client.CallOption) (*ProxyResponse, error) {
req := c.c.NewRequest(c.name, "Function.Proxy", in)
out := new(ProxyResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *functionService) Regions(ctx context.Context, in *RegionsRequest, opts ...client.CallOption) (*RegionsResponse, error) {
req := c.c.NewRequest(c.name, "Function.Regions", in)
out := new(RegionsResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *functionService) Reserve(ctx context.Context, in *ReserveRequest, opts ...client.CallOption) (*ReserveResponse, error) {
req := c.c.NewRequest(c.name, "Function.Reserve", in)
out := new(ReserveResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Function service
type FunctionHandler interface {
Call(context.Context, *CallRequest, *CallResponse) error
Deploy(context.Context, *DeployRequest, *DeployResponse) error
List(context.Context, *ListRequest, *ListResponse) error
Delete(context.Context, *DeleteRequest, *DeleteResponse) error
Describe(context.Context, *DescribeRequest, *DescribeResponse) error
Update(context.Context, *UpdateRequest, *UpdateResponse) error
Proxy(context.Context, *ProxyRequest, *ProxyResponse) error
Regions(context.Context, *RegionsRequest, *RegionsResponse) error
Reserve(context.Context, *ReserveRequest, *ReserveResponse) error
}
func RegisterFunctionHandler(s server.Server, hdlr FunctionHandler, opts ...server.HandlerOption) error {
type function interface {
Call(ctx context.Context, in *CallRequest, out *CallResponse) error
Deploy(ctx context.Context, in *DeployRequest, out *DeployResponse) error
List(ctx context.Context, in *ListRequest, out *ListResponse) error
Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error
Describe(ctx context.Context, in *DescribeRequest, out *DescribeResponse) error
Update(ctx context.Context, in *UpdateRequest, out *UpdateResponse) error
Proxy(ctx context.Context, in *ProxyRequest, out *ProxyResponse) error
Regions(ctx context.Context, in *RegionsRequest, out *RegionsResponse) error
Reserve(ctx context.Context, in *ReserveRequest, out *ReserveResponse) error
}
type Function struct {
function
}
h := &functionHandler{hdlr}
return s.Handle(s.NewHandler(&Function{h}, opts...))
}
type functionHandler struct {
FunctionHandler
}
func (h *functionHandler) Call(ctx context.Context, in *CallRequest, out *CallResponse) error {
return h.FunctionHandler.Call(ctx, in, out)
}
func (h *functionHandler) Deploy(ctx context.Context, in *DeployRequest, out *DeployResponse) error {
return h.FunctionHandler.Deploy(ctx, in, out)
}
func (h *functionHandler) List(ctx context.Context, in *ListRequest, out *ListResponse) error {
return h.FunctionHandler.List(ctx, in, out)
}
func (h *functionHandler) Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error {
return h.FunctionHandler.Delete(ctx, in, out)
}
func (h *functionHandler) Describe(ctx context.Context, in *DescribeRequest, out *DescribeResponse) error {
return h.FunctionHandler.Describe(ctx, in, out)
}
func (h *functionHandler) Update(ctx context.Context, in *UpdateRequest, out *UpdateResponse) error {
return h.FunctionHandler.Update(ctx, in, out)
}
func (h *functionHandler) Proxy(ctx context.Context, in *ProxyRequest, out *ProxyResponse) error {
return h.FunctionHandler.Proxy(ctx, in, out)
}
func (h *functionHandler) Regions(ctx context.Context, in *RegionsRequest, out *RegionsResponse) error {
return h.FunctionHandler.Regions(ctx, in, out)
}
func (h *functionHandler) Reserve(ctx context.Context, in *ReserveRequest, out *ReserveResponse) error {
return h.FunctionHandler.Reserve(ctx, in, out)
}