121 lines
3.5 KiB
Go
121 lines
3.5 KiB
Go
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
|
// source: accounts.proto
|
|
|
|
package proto
|
|
|
|
import (
|
|
fmt "fmt"
|
|
proto "github.com/golang/protobuf/proto"
|
|
_ "google.golang.org/genproto/googleapis/api/annotations"
|
|
math "math"
|
|
)
|
|
|
|
import (
|
|
context "context"
|
|
client "github.com/micro/go-micro/v2/client"
|
|
server "github.com/micro/go-micro/v2/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 _ context.Context
|
|
var _ client.Option
|
|
var _ server.Option
|
|
|
|
// Client API for AccountsService service
|
|
|
|
type AccountsService interface {
|
|
Set(ctx context.Context, in *Record, opts ...client.CallOption) (*Record, error)
|
|
Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*Record, error)
|
|
Search(ctx context.Context, in *Query, opts ...client.CallOption) (*Records, error)
|
|
}
|
|
|
|
type accountsService struct {
|
|
c client.Client
|
|
name string
|
|
}
|
|
|
|
func NewAccountsService(name string, c client.Client) AccountsService {
|
|
return &accountsService{
|
|
c: c,
|
|
name: name,
|
|
}
|
|
}
|
|
|
|
func (c *accountsService) Set(ctx context.Context, in *Record, opts ...client.CallOption) (*Record, error) {
|
|
req := c.c.NewRequest(c.name, "AccountsService.Set", in)
|
|
out := new(Record)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accountsService) Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*Record, error) {
|
|
req := c.c.NewRequest(c.name, "AccountsService.Get", in)
|
|
out := new(Record)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *accountsService) Search(ctx context.Context, in *Query, opts ...client.CallOption) (*Records, error) {
|
|
req := c.c.NewRequest(c.name, "AccountsService.Search", in)
|
|
out := new(Records)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for AccountsService service
|
|
|
|
type AccountsServiceHandler interface {
|
|
Set(context.Context, *Record, *Record) error
|
|
Get(context.Context, *GetRequest, *Record) error
|
|
Search(context.Context, *Query, *Records) error
|
|
}
|
|
|
|
func RegisterAccountsServiceHandler(s server.Server, hdlr AccountsServiceHandler, opts ...server.HandlerOption) error {
|
|
type accountsService interface {
|
|
Set(ctx context.Context, in *Record, out *Record) error
|
|
Get(ctx context.Context, in *GetRequest, out *Record) error
|
|
Search(ctx context.Context, in *Query, out *Records) error
|
|
}
|
|
type AccountsService struct {
|
|
accountsService
|
|
}
|
|
h := &accountsServiceHandler{hdlr}
|
|
return s.Handle(s.NewHandler(&AccountsService{h}, opts...))
|
|
}
|
|
|
|
type accountsServiceHandler struct {
|
|
AccountsServiceHandler
|
|
}
|
|
|
|
func (h *accountsServiceHandler) Set(ctx context.Context, in *Record, out *Record) error {
|
|
return h.AccountsServiceHandler.Set(ctx, in, out)
|
|
}
|
|
|
|
func (h *accountsServiceHandler) Get(ctx context.Context, in *GetRequest, out *Record) error {
|
|
return h.AccountsServiceHandler.Get(ctx, in, out)
|
|
}
|
|
|
|
func (h *accountsServiceHandler) Search(ctx context.Context, in *Query, out *Records) error {
|
|
return h.AccountsServiceHandler.Search(ctx, in, out)
|
|
}
|