Files
services/file/proto/file.pb.micro.go
2021-05-19 16:53:42 +01:00

111 lines
2.9 KiB
Go

// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: proto/file.proto
package file
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
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 File service
func NewFileEndpoints() []*api.Endpoint {
return []*api.Endpoint{}
}
// Client API for File service
type FileService interface {
Save(ctx context.Context, in *SaveRequest, opts ...client.CallOption) (*SaveResponse, error)
List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
}
type fileService struct {
c client.Client
name string
}
func NewFileService(name string, c client.Client) FileService {
return &fileService{
c: c,
name: name,
}
}
func (c *fileService) Save(ctx context.Context, in *SaveRequest, opts ...client.CallOption) (*SaveResponse, error) {
req := c.c.NewRequest(c.name, "File.Save", in)
out := new(SaveResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *fileService) List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error) {
req := c.c.NewRequest(c.name, "File.List", in)
out := new(ListResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for File service
type FileHandler interface {
Save(context.Context, *SaveRequest, *SaveResponse) error
List(context.Context, *ListRequest, *ListResponse) error
}
func RegisterFileHandler(s server.Server, hdlr FileHandler, opts ...server.HandlerOption) error {
type file interface {
Save(ctx context.Context, in *SaveRequest, out *SaveResponse) error
List(ctx context.Context, in *ListRequest, out *ListResponse) error
}
type File struct {
file
}
h := &fileHandler{hdlr}
return s.Handle(s.NewHandler(&File{h}, opts...))
}
type fileHandler struct {
FileHandler
}
func (h *fileHandler) Save(ctx context.Context, in *SaveRequest, out *SaveResponse) error {
return h.FileHandler.Save(ctx, in, out)
}
func (h *fileHandler) List(ctx context.Context, in *ListRequest, out *ListResponse) error {
return h.FileHandler.List(ctx, in, out)
}