125 lines
3.9 KiB
Go
125 lines
3.9 KiB
Go
// Code generated by protoc-gen-go.
|
|
// source: go-micro/examples/service/proto/greeter.proto
|
|
// DO NOT EDIT!
|
|
|
|
/*
|
|
Package greeter is a generated protocol buffer package.
|
|
|
|
It is generated from these files:
|
|
go-micro/examples/service/proto/greeter.proto
|
|
|
|
It has these top-level messages:
|
|
HelloRequest
|
|
HelloResponse
|
|
*/
|
|
package greeter
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
|
|
import (
|
|
client "github.com/micro/go-micro/client"
|
|
server "github.com/micro/go-micro/server"
|
|
context "golang.org/x/net/context"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
type HelloRequest struct {
|
|
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
|
|
}
|
|
|
|
func (m *HelloRequest) Reset() { *m = HelloRequest{} }
|
|
func (m *HelloRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*HelloRequest) ProtoMessage() {}
|
|
func (*HelloRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|
|
|
type HelloResponse struct {
|
|
Greeting string `protobuf:"bytes,2,opt,name=greeting" json:"greeting,omitempty"`
|
|
}
|
|
|
|
func (m *HelloResponse) Reset() { *m = HelloResponse{} }
|
|
func (m *HelloResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*HelloResponse) ProtoMessage() {}
|
|
func (*HelloResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
|
|
|
func init() {
|
|
proto.RegisterType((*HelloRequest)(nil), "HelloRequest")
|
|
proto.RegisterType((*HelloResponse)(nil), "HelloResponse")
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ client.Option
|
|
var _ server.Option
|
|
|
|
// Client API for Greeter service
|
|
|
|
type GreeterClient interface {
|
|
Hello(ctx context.Context, in *HelloRequest, opts ...client.CallOption) (*HelloResponse, error)
|
|
}
|
|
|
|
type greeterClient struct {
|
|
c client.Client
|
|
serviceName string
|
|
}
|
|
|
|
func NewGreeterClient(serviceName string, c client.Client) GreeterClient {
|
|
if c == nil {
|
|
c = client.NewClient()
|
|
}
|
|
if len(serviceName) == 0 {
|
|
serviceName = "greeter"
|
|
}
|
|
return &greeterClient{
|
|
c: c,
|
|
serviceName: serviceName,
|
|
}
|
|
}
|
|
|
|
func (c *greeterClient) Hello(ctx context.Context, in *HelloRequest, opts ...client.CallOption) (*HelloResponse, error) {
|
|
req := c.c.NewRequest(c.serviceName, "Greeter.Hello", in)
|
|
out := new(HelloResponse)
|
|
err := c.c.Call(ctx, req, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for Greeter service
|
|
|
|
type GreeterHandler interface {
|
|
Hello(context.Context, *HelloRequest, *HelloResponse) error
|
|
}
|
|
|
|
func RegisterGreeterHandler(s server.Server, hdlr GreeterHandler) {
|
|
s.Handle(s.NewHandler(&Greeter{hdlr}))
|
|
}
|
|
|
|
type Greeter struct {
|
|
GreeterHandler
|
|
}
|
|
|
|
func (h *Greeter) Hello(ctx context.Context, in *HelloRequest, out *HelloResponse) error {
|
|
return h.GreeterHandler.Hello(ctx, in, out)
|
|
}
|
|
|
|
var fileDescriptor0 = []byte{
|
|
// 153 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xd2, 0x4d, 0xcf, 0xd7, 0xcd,
|
|
0xcd, 0x4c, 0x2e, 0xca, 0xd7, 0x4f, 0xad, 0x48, 0xcc, 0x2d, 0xc8, 0x49, 0x2d, 0xd6, 0x2f, 0x4e,
|
|
0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x4f, 0x2f, 0x4a, 0x4d,
|
|
0x2d, 0x49, 0x2d, 0xd2, 0x03, 0xf3, 0x94, 0x64, 0xb8, 0x78, 0x3c, 0x52, 0x73, 0x72, 0xf2, 0x83,
|
|
0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0x78, 0xb8, 0x58, 0xf2, 0x12, 0x73, 0x53, 0x25, 0x18,
|
|
0x15, 0x18, 0x35, 0x38, 0x95, 0x14, 0xb9, 0x78, 0xa1, 0xb2, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9,
|
|
0x42, 0x02, 0x5c, 0x1c, 0x60, 0xfd, 0x99, 0x79, 0xe9, 0x12, 0x4c, 0x20, 0x25, 0x46, 0xc6, 0x5c,
|
|
0xec, 0xee, 0x10, 0x13, 0x85, 0x34, 0xb8, 0x58, 0xc1, 0xaa, 0x85, 0x78, 0xf5, 0x90, 0xcd, 0x94,
|
|
0xe2, 0xd3, 0x43, 0x31, 0x44, 0x89, 0x21, 0x89, 0x0d, 0x6c, 0xb9, 0x31, 0x20, 0x00, 0x00, 0xff,
|
|
0xff, 0x0f, 0xa9, 0x59, 0xb3, 0xad, 0x00, 0x00, 0x00,
|
|
}
|