1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-03-23 20:32:32 +02:00
2021-01-20 21:28:48 +00:00

387 lines
12 KiB
Go

// Code generated by protoc-gen-go. DO NOT EDIT.
// source: github.com/asim/go-micro/examples/v3/server/proto/example/example.proto
/*
Package go_micro_srv_example is a generated protocol buffer package.
It is generated from these files:
github.com/asim/go-micro/examples/v3/server/proto/example/example.proto
It has these top-level messages:
Message
Request
Response
StreamingRequest
StreamingResponse
Ping
Pong
*/
package go_micro_srv_example
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// 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.ProtoPackageIsVersion2 // please upgrade the proto package
type Message struct {
Say string `protobuf:"bytes,1,opt,name=say" json:"say,omitempty"`
}
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} }
func (m *Message) GetSay() string {
if m != nil {
return m.Say
}
return ""
}
type Request struct {
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}
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} }
func (m *Request) GetName() string {
if m != nil {
return m.Name
}
return ""
}
type Response struct {
Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
}
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} }
func (m *Response) GetMsg() string {
if m != nil {
return m.Msg
}
return ""
}
type StreamingRequest struct {
Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"`
}
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} }
func (m *StreamingRequest) GetCount() int64 {
if m != nil {
return m.Count
}
return 0
}
type StreamingResponse struct {
Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"`
}
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} }
func (m *StreamingResponse) GetCount() int64 {
if m != nil {
return m.Count
}
return 0
}
type Ping struct {
Stroke int64 `protobuf:"varint,1,opt,name=stroke" json:"stroke,omitempty"`
}
func (m *Ping) Reset() { *m = Ping{} }
func (m *Ping) String() string { return proto.CompactTextString(m) }
func (*Ping) ProtoMessage() {}
func (*Ping) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
func (m *Ping) GetStroke() int64 {
if m != nil {
return m.Stroke
}
return 0
}
type Pong struct {
Stroke int64 `protobuf:"varint,1,opt,name=stroke" json:"stroke,omitempty"`
}
func (m *Pong) Reset() { *m = Pong{} }
func (m *Pong) String() string { return proto.CompactTextString(m) }
func (*Pong) ProtoMessage() {}
func (*Pong) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
func (m *Pong) GetStroke() int64 {
if m != nil {
return m.Stroke
}
return 0
}
func init() {
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")
proto.RegisterType((*Ping)(nil), "go.micro.srv.example.Ping")
proto.RegisterType((*Pong)(nil), "go.micro.srv.example.Pong")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for Example service
type ExampleClient interface {
Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
Stream(ctx context.Context, in *StreamingRequest, opts ...grpc.CallOption) (Example_StreamClient, error)
PingPong(ctx context.Context, opts ...grpc.CallOption) (Example_PingPongClient, error)
}
type exampleClient struct {
cc *grpc.ClientConn
}
func NewExampleClient(cc *grpc.ClientConn) ExampleClient {
return &exampleClient{cc}
}
func (c *exampleClient) Call(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
out := new(Response)
err := grpc.Invoke(ctx, "/go.micro.srv.example.Example/Call", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *exampleClient) Stream(ctx context.Context, in *StreamingRequest, opts ...grpc.CallOption) (Example_StreamClient, error) {
stream, err := grpc.NewClientStream(ctx, &_Example_serviceDesc.Streams[0], c.cc, "/go.micro.srv.example.Example/Stream", opts...)
if err != nil {
return nil, err
}
x := &exampleStreamClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Example_StreamClient interface {
Recv() (*StreamingResponse, error)
grpc.ClientStream
}
type exampleStreamClient struct {
grpc.ClientStream
}
func (x *exampleStreamClient) Recv() (*StreamingResponse, error) {
m := new(StreamingResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *exampleClient) PingPong(ctx context.Context, opts ...grpc.CallOption) (Example_PingPongClient, error) {
stream, err := grpc.NewClientStream(ctx, &_Example_serviceDesc.Streams[1], c.cc, "/go.micro.srv.example.Example/PingPong", opts...)
if err != nil {
return nil, err
}
x := &examplePingPongClient{stream}
return x, nil
}
type Example_PingPongClient interface {
Send(*Ping) error
Recv() (*Pong, error)
grpc.ClientStream
}
type examplePingPongClient struct {
grpc.ClientStream
}
func (x *examplePingPongClient) Send(m *Ping) error {
return x.ClientStream.SendMsg(m)
}
func (x *examplePingPongClient) Recv() (*Pong, error) {
m := new(Pong)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Server API for Example service
type ExampleServer interface {
Call(context.Context, *Request) (*Response, error)
Stream(*StreamingRequest, Example_StreamServer) error
PingPong(Example_PingPongServer) error
}
func RegisterExampleServer(s *grpc.Server, srv ExampleServer) {
s.RegisterService(&_Example_serviceDesc, srv)
}
func _Example_Call_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ExampleServer).Call(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/go.micro.srv.example.Example/Call",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ExampleServer).Call(ctx, req.(*Request))
}
return interceptor(ctx, in, info, handler)
}
func _Example_Stream_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(StreamingRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ExampleServer).Stream(m, &exampleStreamServer{stream})
}
type Example_StreamServer interface {
Send(*StreamingResponse) error
grpc.ServerStream
}
type exampleStreamServer struct {
grpc.ServerStream
}
func (x *exampleStreamServer) Send(m *StreamingResponse) error {
return x.ServerStream.SendMsg(m)
}
func _Example_PingPong_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ExampleServer).PingPong(&examplePingPongServer{stream})
}
type Example_PingPongServer interface {
Send(*Pong) error
Recv() (*Ping, error)
grpc.ServerStream
}
type examplePingPongServer struct {
grpc.ServerStream
}
func (x *examplePingPongServer) Send(m *Pong) error {
return x.ServerStream.SendMsg(m)
}
func (x *examplePingPongServer) Recv() (*Ping, error) {
m := new(Ping)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
var _Example_serviceDesc = grpc.ServiceDesc{
ServiceName: "go.micro.srv.example.Example",
HandlerType: (*ExampleServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Call",
Handler: _Example_Call_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Stream",
Handler: _Example_Stream_Handler,
ServerStreams: true,
},
{
StreamName: "PingPong",
Handler: _Example_PingPong_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "github.com/asim/go-micro/examples/v3/server/proto/example/example.proto",
}
func init() {
proto.RegisterFile("github.com/asim/go-micro/examples/v3/server/proto/example/example.proto", fileDescriptor0)
}
var fileDescriptor0 = []byte{
// 291 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xc1, 0x4b, 0x2b, 0x31,
0x10, 0xc6, 0x1b, 0xda, 0xd7, 0xf6, 0xcd, 0xa9, 0x86, 0x22, 0xb2, 0xda, 0x22, 0x39, 0x68, 0xbd,
0x64, 0x8b, 0x5e, 0xbd, 0x89, 0xe8, 0x45, 0x90, 0xf5, 0xec, 0x21, 0x2d, 0x43, 0x5c, 0x6c, 0x92,
0x9a, 0x49, 0x8b, 0xfe, 0xed, 0x5e, 0x64, 0xb3, 0x59, 0x11, 0xd9, 0xc5, 0x53, 0x66, 0xe6, 0xf7,
0x7d, 0xc3, 0xcc, 0x10, 0xb8, 0xd6, 0x65, 0x78, 0xd9, 0xad, 0xe4, 0xda, 0x99, 0xdc, 0x94, 0x6b,
0xef, 0x72, 0x7c, 0x57, 0x66, 0xbb, 0x41, 0xca, 0x09, 0xfd, 0x1e, 0x7d, 0xbe, 0xf5, 0x2e, 0x7c,
0x57, 0x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