Files
services/ask/proto/ask.pb.micro.go
2021-06-30 14:58:37 +01:00

94 lines
2.3 KiB
Go

// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: proto/ask.proto
package ask
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 Ask service
func NewAskEndpoints() []*api.Endpoint {
return []*api.Endpoint{}
}
// Client API for Ask service
type AskService interface {
Question(ctx context.Context, in *QuestionRequest, opts ...client.CallOption) (*QuestionResponse, error)
}
type askService struct {
c client.Client
name string
}
func NewAskService(name string, c client.Client) AskService {
return &askService{
c: c,
name: name,
}
}
func (c *askService) Question(ctx context.Context, in *QuestionRequest, opts ...client.CallOption) (*QuestionResponse, error) {
req := c.c.NewRequest(c.name, "Ask.Question", in)
out := new(QuestionResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Ask service
type AskHandler interface {
Question(context.Context, *QuestionRequest, *QuestionResponse) error
}
func RegisterAskHandler(s server.Server, hdlr AskHandler, opts ...server.HandlerOption) error {
type ask interface {
Question(ctx context.Context, in *QuestionRequest, out *QuestionResponse) error
}
type Ask struct {
ask
}
h := &askHandler{hdlr}
return s.Handle(s.NewHandler(&Ask{h}, opts...))
}
type askHandler struct {
AskHandler
}
func (h *askHandler) Question(ctx context.Context, in *QuestionRequest, out *QuestionResponse) error {
return h.AskHandler.Question(ctx, in, out)
}