Files
services/inbox/proto/inbox.pb.micro.go
Ben Toogood 62918d0537 Inbox Proto
2020-10-15 15:23:09 +01:00

145 lines
4.3 KiB
Go

// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: github.com/micro/services/inbox/proto/inbox.proto
package inbox
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 Inbox service
func NewInboxEndpoints() []*api.Endpoint {
return []*api.Endpoint{}
}
// Client API for Inbox service
type InboxService interface {
Create(ctx context.Context, in *CreateRequest, opts ...client.CallOption) (*CreateResponse, error)
Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error)
Update(ctx context.Context, in *UpdateRequest, opts ...client.CallOption) (*UpdateResponse, error)
Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error)
}
type inboxService struct {
c client.Client
name string
}
func NewInboxService(name string, c client.Client) InboxService {
return &inboxService{
c: c,
name: name,
}
}
func (c *inboxService) Create(ctx context.Context, in *CreateRequest, opts ...client.CallOption) (*CreateResponse, error) {
req := c.c.NewRequest(c.name, "Inbox.Create", in)
out := new(CreateResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *inboxService) Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error) {
req := c.c.NewRequest(c.name, "Inbox.Read", in)
out := new(ReadResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *inboxService) Update(ctx context.Context, in *UpdateRequest, opts ...client.CallOption) (*UpdateResponse, error) {
req := c.c.NewRequest(c.name, "Inbox.Update", in)
out := new(UpdateResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *inboxService) Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error) {
req := c.c.NewRequest(c.name, "Inbox.Delete", in)
out := new(DeleteResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Inbox service
type InboxHandler interface {
Create(context.Context, *CreateRequest, *CreateResponse) error
Read(context.Context, *ReadRequest, *ReadResponse) error
Update(context.Context, *UpdateRequest, *UpdateResponse) error
Delete(context.Context, *DeleteRequest, *DeleteResponse) error
}
func RegisterInboxHandler(s server.Server, hdlr InboxHandler, opts ...server.HandlerOption) error {
type inbox interface {
Create(ctx context.Context, in *CreateRequest, out *CreateResponse) error
Read(ctx context.Context, in *ReadRequest, out *ReadResponse) error
Update(ctx context.Context, in *UpdateRequest, out *UpdateResponse) error
Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error
}
type Inbox struct {
inbox
}
h := &inboxHandler{hdlr}
return s.Handle(s.NewHandler(&Inbox{h}, opts...))
}
type inboxHandler struct {
InboxHandler
}
func (h *inboxHandler) Create(ctx context.Context, in *CreateRequest, out *CreateResponse) error {
return h.InboxHandler.Create(ctx, in, out)
}
func (h *inboxHandler) Read(ctx context.Context, in *ReadRequest, out *ReadResponse) error {
return h.InboxHandler.Read(ctx, in, out)
}
func (h *inboxHandler) Update(ctx context.Context, in *UpdateRequest, out *UpdateResponse) error {
return h.InboxHandler.Update(ctx, in, out)
}
func (h *inboxHandler) Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error {
return h.InboxHandler.Delete(ctx, in, out)
}