2019-06-05 12:22:28 +03:00
|
|
|
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
2020-09-20 16:08:45 +03:00
|
|
|
// source: test.proto
|
2019-06-05 12:22:28 +03:00
|
|
|
|
2020-09-20 16:08:45 +03:00
|
|
|
package helloworld
|
2019-06-05 12:22:28 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
fmt "fmt"
|
|
|
|
proto "github.com/golang/protobuf/proto"
|
|
|
|
math "math"
|
|
|
|
)
|
|
|
|
|
|
|
|
import (
|
|
|
|
context "context"
|
2020-09-20 16:08:45 +03:00
|
|
|
api "github.com/unistack-org/micro/v3/api"
|
|
|
|
client "github.com/unistack-org/micro/v3/client"
|
|
|
|
server "github.com/unistack-org/micro/v3/server"
|
2019-06-05 12:22:28 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
// 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.
|
2020-04-14 16:25:09 +03:00
|
|
|
var _ api.Endpoint
|
2019-06-05 12:22:28 +03:00
|
|
|
var _ context.Context
|
|
|
|
var _ client.Option
|
|
|
|
var _ server.Option
|
|
|
|
|
2020-04-14 16:25:09 +03:00
|
|
|
// Api Endpoints for Test service
|
|
|
|
|
|
|
|
func NewTestEndpoints() []*api.Endpoint {
|
2020-09-20 16:08:45 +03:00
|
|
|
return []*api.Endpoint{}
|
2020-04-14 16:25:09 +03:00
|
|
|
}
|
|
|
|
|
2019-06-05 12:22:28 +03:00
|
|
|
// Client API for Test service
|
|
|
|
|
|
|
|
type TestService interface {
|
2020-09-20 16:08:45 +03:00
|
|
|
Call(ctx context.Context, req *Request, opts ...client.CallOption) (*Response, error)
|
2019-06-05 12:22:28 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type testService struct {
|
|
|
|
c client.Client
|
|
|
|
name string
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewTestService(name string, c client.Client) TestService {
|
|
|
|
return &testService{
|
|
|
|
c: c,
|
|
|
|
name: name,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-20 16:08:45 +03:00
|
|
|
func (c *testService) Call(ctx context.Context, req *Request, opts ...client.CallOption) (*Response, error) {
|
|
|
|
rsp := &Response{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "Test.Call", req), rsp, opts...)
|
2020-04-29 15:23:10 +03:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2020-09-20 16:08:45 +03:00
|
|
|
return rsp, nil
|
2020-04-29 15:23:10 +03:00
|
|
|
}
|
|
|
|
|
2019-06-05 12:22:28 +03:00
|
|
|
// Server API for Test service
|
|
|
|
|
|
|
|
type TestHandler interface {
|
|
|
|
Call(context.Context, *Request, *Response) error
|
|
|
|
}
|
|
|
|
|
|
|
|
func RegisterTestHandler(s server.Server, hdlr TestHandler, opts ...server.HandlerOption) error {
|
|
|
|
type test interface {
|
2020-09-20 16:08:45 +03:00
|
|
|
Call(ctx context.Context, req *Request, rsp *Response) error
|
2019-06-05 12:22:28 +03:00
|
|
|
}
|
|
|
|
type Test struct {
|
|
|
|
test
|
|
|
|
}
|
|
|
|
h := &testHandler{hdlr}
|
|
|
|
return s.Handle(s.NewHandler(&Test{h}, opts...))
|
|
|
|
}
|
|
|
|
|
|
|
|
type testHandler struct {
|
|
|
|
TestHandler
|
|
|
|
}
|
|
|
|
|
2020-09-20 16:08:45 +03:00
|
|
|
func (h *testHandler) Call(ctx context.Context, req *Request, rsp *Response) error {
|
|
|
|
return h.TestHandler.Call(ctx, req, rsp)
|
2020-04-29 15:23:10 +03:00
|
|
|
}
|