micro/examples/server/proto/example/example.pb.go

184 lines
6.4 KiB
Go
Raw Normal View History

2015-01-14 13:50:54 +03:00
// Code generated by protoc-gen-go.
// source: go-micro/examples/server/proto/example/example.proto
2015-01-14 02:31:27 +03:00
// DO NOT EDIT!
2015-05-05 21:05:06 +03:00
/*
2015-12-03 01:44:01 +03:00
Package go_micro_srv_example is a generated protocol buffer package.
2015-05-05 21:05:06 +03:00
It is generated from these files:
go-micro/examples/server/proto/example/example.proto
2015-05-05 21:05:06 +03:00
It has these top-level messages:
Message
2015-05-05 21:05:06 +03:00
Request
Response
StreamingRequest
StreamingResponse
2015-05-05 21:05:06 +03:00
*/
2015-12-03 01:44:01 +03:00
package go_micro_srv_example
2015-01-14 02:31:27 +03:00
2015-05-05 21:05:06 +03:00
import proto "github.com/golang/protobuf/proto"
2015-12-03 01:44:01 +03:00
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"
2015-12-03 01:44:01 +03:00
)
2015-01-14 02:31:27 +03:00
2015-05-05 21:05:06 +03:00
// Reference imports to suppress errors if they are not otherwise used.
2015-01-14 02:31:27 +03:00
var _ = proto.Marshal
2015-12-03 01:44:01 +03:00
var _ = fmt.Errorf
var _ = math.Inf
2015-01-14 02:31:27 +03:00
type Message struct {
Say string `protobuf:"bytes,1,opt,name=say" json:"say,omitempty"`
}
2015-12-03 01:44:01 +03:00
func (m *Message) Reset() { *m = Message{} }
func (m *Message) String() string { return proto.CompactTextString(m) }
func (*Message) ProtoMessage() {}
func (*Message) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
2015-01-14 02:31:27 +03:00
type Request struct {
2015-05-09 02:42:07 +03:00
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
2015-01-14 02:31:27 +03:00
}
2015-12-03 01:44:01 +03:00
func (m *Request) Reset() { *m = Request{} }
func (m *Request) String() string { return proto.CompactTextString(m) }
func (*Request) ProtoMessage() {}
func (*Request) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
2015-01-14 02:31:27 +03:00
type Response struct {
2015-05-09 02:42:07 +03:00
Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
2015-01-14 02:31:27 +03:00
}
2015-12-03 01:44:01 +03:00
func (m *Response) Reset() { *m = Response{} }
func (m *Response) String() string { return proto.CompactTextString(m) }
func (*Response) ProtoMessage() {}
func (*Response) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
2015-01-14 02:31:27 +03:00
type StreamingRequest struct {
Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"`
}
2015-12-03 01:44:01 +03:00
func (m *StreamingRequest) Reset() { *m = StreamingRequest{} }
func (m *StreamingRequest) String() string { return proto.CompactTextString(m) }
func (*StreamingRequest) ProtoMessage() {}
func (*StreamingRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
type StreamingResponse struct {
Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"`
}
2015-12-03 01:44:01 +03:00
func (m *StreamingResponse) Reset() { *m = StreamingResponse{} }
func (m *StreamingResponse) String() string { return proto.CompactTextString(m) }
func (*StreamingResponse) ProtoMessage() {}
func (*StreamingResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
2015-01-14 02:31:27 +03:00
func init() {
2015-12-03 01:44:01 +03:00
proto.RegisterType((*Message)(nil), "go.micro.srv.example.Message")
proto.RegisterType((*Request)(nil), "go.micro.srv.example.Request")
proto.RegisterType((*Response)(nil), "go.micro.srv.example.Response")
proto.RegisterType((*StreamingRequest)(nil), "go.micro.srv.example.StreamingRequest")
proto.RegisterType((*StreamingResponse)(nil), "go.micro.srv.example.StreamingResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ client.Option
var _ server.Option
// Client API for Example service
type ExampleClient interface {
2015-12-10 00:41:55 +03:00
Call(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error)
Stream(ctx context.Context, in *StreamingRequest, opts ...client.CallOption) (Example_StreamClient, error)
2015-12-03 01:44:01 +03:00
}
type exampleClient struct {
c client.Client
serviceName string
2015-12-03 01:44:01 +03:00
}
func NewExampleClient(serviceName string, c client.Client) ExampleClient {
2015-12-03 01:44:01 +03:00
if c == nil {
c = client.NewClient()
}
if len(serviceName) == 0 {
serviceName = "go.micro.srv.example"
}
2015-12-03 01:44:01 +03:00
return &exampleClient{
c: c,
serviceName: serviceName,
2015-12-03 01:44:01 +03:00
}
}
2015-12-10 00:41:55 +03:00
func (c *exampleClient) Call(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) {
req := c.c.NewRequest(c.serviceName, "Example.Call", in)
2015-12-03 01:44:01 +03:00
out := new(Response)
2015-12-10 00:41:55 +03:00
err := c.c.Call(ctx, req, out, opts...)
2015-12-03 01:44:01 +03:00
if err != nil {
return nil, err
}
return out, nil
}
2015-12-10 00:41:55 +03:00
func (c *exampleClient) Stream(ctx context.Context, in *StreamingRequest, opts ...client.CallOption) (Example_StreamClient, error) {
req := c.c.NewRequest(c.serviceName, "Example.Stream", in)
2015-12-17 23:37:35 +03:00
stream, err := c.c.Stream(ctx, req, opts...)
2015-12-03 01:44:01 +03:00
if err != nil {
return nil, err
}
2015-12-17 23:37:35 +03:00
return &exampleStreamClient{stream}, nil
2015-12-03 01:44:01 +03:00
}
type Example_StreamClient interface {
2015-12-17 23:37:35 +03:00
RecvMsg() (*StreamingResponse, error)
2015-12-03 01:44:01 +03:00
client.Streamer
}
type exampleStreamClient struct {
client.Streamer
}
2015-12-17 23:37:35 +03:00
func (x *exampleStreamClient) RecvMsg() (*StreamingResponse, error) {
m := new(StreamingResponse)
err := x.Recv(m)
if err != nil {
return nil, err
2015-12-03 01:44:01 +03:00
}
2015-12-17 23:37:35 +03:00
return m, nil
2015-12-03 01:44:01 +03:00
}
// Server API for Example service
type ExampleHandler interface {
2015-12-03 02:05:52 +03:00
Call(context.Context, *Request, *Response) error
Stream(context.Context, func(*StreamingResponse) error) error
2015-12-03 01:44:01 +03:00
}
func RegisterExampleHandler(s server.Server, hdlr ExampleHandler) {
s.Handle(s.NewHandler(hdlr))
2015-12-03 01:44:01 +03:00
}
var fileDescriptor0 = []byte{
// 230 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x90, 0xcd, 0x4a, 0xc5, 0x30,
0x10, 0x85, 0x0d, 0xf7, 0x7a, 0xab, 0xa3, 0x82, 0x06, 0x51, 0x29, 0x28, 0x9a, 0x85, 0xba, 0x31,
0x15, 0xf5, 0x0d, 0x44, 0x5c, 0xb9, 0xa9, 0x6b, 0x17, 0xb1, 0x0c, 0xa1, 0xd0, 0x24, 0x35, 0x93,
0x16, 0x7d, 0x2c, 0xdf, 0x50, 0x48, 0xd3, 0xa2, 0x52, 0x71, 0x15, 0x98, 0xf3, 0x9d, 0x1f, 0x02,
0x77, 0xda, 0x5d, 0x99, 0xba, 0xf2, 0xae, 0xc0, 0x77, 0x65, 0xda, 0x06, 0xa9, 0x20, 0xf4, 0x3d,
0xfa, 0xa2, 0xf5, 0x2e, 0x4c, 0xd7, 0xf1, 0x95, 0xf1, 0xca, 0xf7, 0xb5, 0x93, 0xd1, 0x25, 0xc9,
0xf7, 0x32, 0x69, 0xe2, 0x00, 0xb2, 0x27, 0x24, 0x52, 0x1a, 0xf9, 0x16, 0x2c, 0x48, 0x7d, 0x1c,
0xb1, 0x53, 0x76, 0xb9, 0x29, 0x0e, 0x21, 0x2b, 0xf1, 0xad, 0x43, 0x0a, 0x7c, 0x1b, 0x96, 0x56,
0x19, 0x9c, 0x84, 0x8d, 0x12, 0xa9, 0x75, 0x96, 0xa2, 0xc3, 0x90, 0x4e, 0xc2, 0x19, 0xec, 0x3e,
0x07, 0x8f, 0xca, 0xd4, 0x56, 0x8f, 0xd6, 0x1d, 0x58, 0xaf, 0x5c, 0x67, 0x43, 0x44, 0x16, 0x42,
0xc0, 0xde, 0x37, 0x24, 0x85, 0xfc, 0x64, 0x6e, 0x3e, 0x19, 0x64, 0x0f, 0xc3, 0x38, 0xfe, 0x08,
0xcb, 0x7b, 0xd5, 0x34, 0xfc, 0x58, 0xce, 0x6d, 0x97, 0xa9, 0x25, 0x3f, 0xf9, 0x4b, 0x1e, 0x1a,
0xc4, 0x1a, 0x7f, 0x81, 0xd5, 0x50, 0xcc, 0xcf, 0xe7, 0xd9, 0xdf, 0xcb, 0xf3, 0x8b, 0x7f, 0xb9,
0x31, 0xfc, 0x9a, 0xbd, 0xae, 0xe2, 0x0f, 0xdf, 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, 0x63, 0x02,
0xbf, 0x5f, 0x99, 0x01, 0x00, 0x00,
2015-01-14 02:31:27 +03:00
}