...

Source file src/github.com/tmc/grpc-websocket-proxy/_examples/cmd/wsechoserver/echoserver/echoserver.pb.go

Documentation: github.com/tmc/grpc-websocket-proxy/_examples/cmd/wsechoserver/echoserver

     1  // Code generated by protoc-gen-go.
     2  // source: echoserver.proto
     3  // DO NOT EDIT!
     4  
     5  /*
     6  Package echoserver is a generated protocol buffer package.
     7  
     8  It is generated from these files:
     9  	echoserver.proto
    10  
    11  It has these top-level messages:
    12  	EchoRequest
    13  	EchoResponse
    14  	Heartbeat
    15  	Empty
    16  */
    17  package echoserver
    18  
    19  import proto "github.com/golang/protobuf/proto"
    20  import fmt "fmt"
    21  import math "math"
    22  import _ "google.golang.org/genproto/googleapis/api/annotations"
    23  
    24  import (
    25  	context "golang.org/x/net/context"
    26  	grpc "google.golang.org/grpc"
    27  )
    28  
    29  // Reference imports to suppress errors if they are not otherwise used.
    30  var _ = proto.Marshal
    31  var _ = fmt.Errorf
    32  var _ = math.Inf
    33  
    34  // This is a compile-time assertion to ensure that this generated file
    35  // is compatible with the proto package it is being compiled against.
    36  // A compilation error at this line likely means your copy of the
    37  // proto package needs to be updated.
    38  const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
    39  
    40  type Heartbeat_Status int32
    41  
    42  const (
    43  	Heartbeat_UNKNOWN Heartbeat_Status = 0
    44  	Heartbeat_OK      Heartbeat_Status = 1
    45  )
    46  
    47  var Heartbeat_Status_name = map[int32]string{
    48  	0: "UNKNOWN",
    49  	1: "OK",
    50  }
    51  var Heartbeat_Status_value = map[string]int32{
    52  	"UNKNOWN": 0,
    53  	"OK":      1,
    54  }
    55  
    56  func (x Heartbeat_Status) String() string {
    57  	return proto.EnumName(Heartbeat_Status_name, int32(x))
    58  }
    59  func (Heartbeat_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} }
    60  
    61  type EchoRequest struct {
    62  	Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
    63  }
    64  
    65  func (m *EchoRequest) Reset()                    { *m = EchoRequest{} }
    66  func (m *EchoRequest) String() string            { return proto.CompactTextString(m) }
    67  func (*EchoRequest) ProtoMessage()               {}
    68  func (*EchoRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
    69  
    70  func (m *EchoRequest) GetMessage() string {
    71  	if m != nil {
    72  		return m.Message
    73  	}
    74  	return ""
    75  }
    76  
    77  type EchoResponse struct {
    78  	Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
    79  }
    80  
    81  func (m *EchoResponse) Reset()                    { *m = EchoResponse{} }
    82  func (m *EchoResponse) String() string            { return proto.CompactTextString(m) }
    83  func (*EchoResponse) ProtoMessage()               {}
    84  func (*EchoResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
    85  
    86  func (m *EchoResponse) GetMessage() string {
    87  	if m != nil {
    88  		return m.Message
    89  	}
    90  	return ""
    91  }
    92  
    93  type Heartbeat struct {
    94  	Status Heartbeat_Status `protobuf:"varint,1,opt,name=status,enum=echoserver.Heartbeat_Status" json:"status,omitempty"`
    95  }
    96  
    97  func (m *Heartbeat) Reset()                    { *m = Heartbeat{} }
    98  func (m *Heartbeat) String() string            { return proto.CompactTextString(m) }
    99  func (*Heartbeat) ProtoMessage()               {}
   100  func (*Heartbeat) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
   101  
   102  func (m *Heartbeat) GetStatus() Heartbeat_Status {
   103  	if m != nil {
   104  		return m.Status
   105  	}
   106  	return Heartbeat_UNKNOWN
   107  }
   108  
   109  type Empty struct {
   110  }
   111  
   112  func (m *Empty) Reset()                    { *m = Empty{} }
   113  func (m *Empty) String() string            { return proto.CompactTextString(m) }
   114  func (*Empty) ProtoMessage()               {}
   115  func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
   116  
   117  func init() {
   118  	proto.RegisterType((*EchoRequest)(nil), "echoserver.EchoRequest")
   119  	proto.RegisterType((*EchoResponse)(nil), "echoserver.EchoResponse")
   120  	proto.RegisterType((*Heartbeat)(nil), "echoserver.Heartbeat")
   121  	proto.RegisterType((*Empty)(nil), "echoserver.Empty")
   122  	proto.RegisterEnum("echoserver.Heartbeat_Status", Heartbeat_Status_name, Heartbeat_Status_value)
   123  }
   124  
   125  // Reference imports to suppress errors if they are not otherwise used.
   126  var _ context.Context
   127  var _ grpc.ClientConn
   128  
   129  // This is a compile-time assertion to ensure that this generated file
   130  // is compatible with the grpc package it is being compiled against.
   131  const _ = grpc.SupportPackageIsVersion4
   132  
   133  // Client API for EchoService service
   134  
   135  type EchoServiceClient interface {
   136  	Echo(ctx context.Context, opts ...grpc.CallOption) (EchoService_EchoClient, error)
   137  	Stream(ctx context.Context, in *Empty, opts ...grpc.CallOption) (EchoService_StreamClient, error)
   138  	Heartbeats(ctx context.Context, opts ...grpc.CallOption) (EchoService_HeartbeatsClient, error)
   139  }
   140  
   141  type echoServiceClient struct {
   142  	cc *grpc.ClientConn
   143  }
   144  
   145  func NewEchoServiceClient(cc *grpc.ClientConn) EchoServiceClient {
   146  	return &echoServiceClient{cc}
   147  }
   148  
   149  func (c *echoServiceClient) Echo(ctx context.Context, opts ...grpc.CallOption) (EchoService_EchoClient, error) {
   150  	stream, err := grpc.NewClientStream(ctx, &_EchoService_serviceDesc.Streams[0], c.cc, "/echoserver.EchoService/Echo", opts...)
   151  	if err != nil {
   152  		return nil, err
   153  	}
   154  	x := &echoServiceEchoClient{stream}
   155  	return x, nil
   156  }
   157  
   158  type EchoService_EchoClient interface {
   159  	Send(*EchoRequest) error
   160  	Recv() (*EchoResponse, error)
   161  	grpc.ClientStream
   162  }
   163  
   164  type echoServiceEchoClient struct {
   165  	grpc.ClientStream
   166  }
   167  
   168  func (x *echoServiceEchoClient) Send(m *EchoRequest) error {
   169  	return x.ClientStream.SendMsg(m)
   170  }
   171  
   172  func (x *echoServiceEchoClient) Recv() (*EchoResponse, error) {
   173  	m := new(EchoResponse)
   174  	if err := x.ClientStream.RecvMsg(m); err != nil {
   175  		return nil, err
   176  	}
   177  	return m, nil
   178  }
   179  
   180  func (c *echoServiceClient) Stream(ctx context.Context, in *Empty, opts ...grpc.CallOption) (EchoService_StreamClient, error) {
   181  	stream, err := grpc.NewClientStream(ctx, &_EchoService_serviceDesc.Streams[1], c.cc, "/echoserver.EchoService/Stream", opts...)
   182  	if err != nil {
   183  		return nil, err
   184  	}
   185  	x := &echoServiceStreamClient{stream}
   186  	if err := x.ClientStream.SendMsg(in); err != nil {
   187  		return nil, err
   188  	}
   189  	if err := x.ClientStream.CloseSend(); err != nil {
   190  		return nil, err
   191  	}
   192  	return x, nil
   193  }
   194  
   195  type EchoService_StreamClient interface {
   196  	Recv() (*EchoResponse, error)
   197  	grpc.ClientStream
   198  }
   199  
   200  type echoServiceStreamClient struct {
   201  	grpc.ClientStream
   202  }
   203  
   204  func (x *echoServiceStreamClient) Recv() (*EchoResponse, error) {
   205  	m := new(EchoResponse)
   206  	if err := x.ClientStream.RecvMsg(m); err != nil {
   207  		return nil, err
   208  	}
   209  	return m, nil
   210  }
   211  
   212  func (c *echoServiceClient) Heartbeats(ctx context.Context, opts ...grpc.CallOption) (EchoService_HeartbeatsClient, error) {
   213  	stream, err := grpc.NewClientStream(ctx, &_EchoService_serviceDesc.Streams[2], c.cc, "/echoserver.EchoService/Heartbeats", opts...)
   214  	if err != nil {
   215  		return nil, err
   216  	}
   217  	x := &echoServiceHeartbeatsClient{stream}
   218  	return x, nil
   219  }
   220  
   221  type EchoService_HeartbeatsClient interface {
   222  	Send(*Empty) error
   223  	Recv() (*Heartbeat, error)
   224  	grpc.ClientStream
   225  }
   226  
   227  type echoServiceHeartbeatsClient struct {
   228  	grpc.ClientStream
   229  }
   230  
   231  func (x *echoServiceHeartbeatsClient) Send(m *Empty) error {
   232  	return x.ClientStream.SendMsg(m)
   233  }
   234  
   235  func (x *echoServiceHeartbeatsClient) Recv() (*Heartbeat, error) {
   236  	m := new(Heartbeat)
   237  	if err := x.ClientStream.RecvMsg(m); err != nil {
   238  		return nil, err
   239  	}
   240  	return m, nil
   241  }
   242  
   243  // Server API for EchoService service
   244  
   245  type EchoServiceServer interface {
   246  	Echo(EchoService_EchoServer) error
   247  	Stream(*Empty, EchoService_StreamServer) error
   248  	Heartbeats(EchoService_HeartbeatsServer) error
   249  }
   250  
   251  func RegisterEchoServiceServer(s *grpc.Server, srv EchoServiceServer) {
   252  	s.RegisterService(&_EchoService_serviceDesc, srv)
   253  }
   254  
   255  func _EchoService_Echo_Handler(srv interface{}, stream grpc.ServerStream) error {
   256  	return srv.(EchoServiceServer).Echo(&echoServiceEchoServer{stream})
   257  }
   258  
   259  type EchoService_EchoServer interface {
   260  	Send(*EchoResponse) error
   261  	Recv() (*EchoRequest, error)
   262  	grpc.ServerStream
   263  }
   264  
   265  type echoServiceEchoServer struct {
   266  	grpc.ServerStream
   267  }
   268  
   269  func (x *echoServiceEchoServer) Send(m *EchoResponse) error {
   270  	return x.ServerStream.SendMsg(m)
   271  }
   272  
   273  func (x *echoServiceEchoServer) Recv() (*EchoRequest, error) {
   274  	m := new(EchoRequest)
   275  	if err := x.ServerStream.RecvMsg(m); err != nil {
   276  		return nil, err
   277  	}
   278  	return m, nil
   279  }
   280  
   281  func _EchoService_Stream_Handler(srv interface{}, stream grpc.ServerStream) error {
   282  	m := new(Empty)
   283  	if err := stream.RecvMsg(m); err != nil {
   284  		return err
   285  	}
   286  	return srv.(EchoServiceServer).Stream(m, &echoServiceStreamServer{stream})
   287  }
   288  
   289  type EchoService_StreamServer interface {
   290  	Send(*EchoResponse) error
   291  	grpc.ServerStream
   292  }
   293  
   294  type echoServiceStreamServer struct {
   295  	grpc.ServerStream
   296  }
   297  
   298  func (x *echoServiceStreamServer) Send(m *EchoResponse) error {
   299  	return x.ServerStream.SendMsg(m)
   300  }
   301  
   302  func _EchoService_Heartbeats_Handler(srv interface{}, stream grpc.ServerStream) error {
   303  	return srv.(EchoServiceServer).Heartbeats(&echoServiceHeartbeatsServer{stream})
   304  }
   305  
   306  type EchoService_HeartbeatsServer interface {
   307  	Send(*Heartbeat) error
   308  	Recv() (*Empty, error)
   309  	grpc.ServerStream
   310  }
   311  
   312  type echoServiceHeartbeatsServer struct {
   313  	grpc.ServerStream
   314  }
   315  
   316  func (x *echoServiceHeartbeatsServer) Send(m *Heartbeat) error {
   317  	return x.ServerStream.SendMsg(m)
   318  }
   319  
   320  func (x *echoServiceHeartbeatsServer) Recv() (*Empty, error) {
   321  	m := new(Empty)
   322  	if err := x.ServerStream.RecvMsg(m); err != nil {
   323  		return nil, err
   324  	}
   325  	return m, nil
   326  }
   327  
   328  var _EchoService_serviceDesc = grpc.ServiceDesc{
   329  	ServiceName: "echoserver.EchoService",
   330  	HandlerType: (*EchoServiceServer)(nil),
   331  	Methods:     []grpc.MethodDesc{},
   332  	Streams: []grpc.StreamDesc{
   333  		{
   334  			StreamName:    "Echo",
   335  			Handler:       _EchoService_Echo_Handler,
   336  			ServerStreams: true,
   337  			ClientStreams: true,
   338  		},
   339  		{
   340  			StreamName:    "Stream",
   341  			Handler:       _EchoService_Stream_Handler,
   342  			ServerStreams: true,
   343  		},
   344  		{
   345  			StreamName:    "Heartbeats",
   346  			Handler:       _EchoService_Heartbeats_Handler,
   347  			ServerStreams: true,
   348  			ClientStreams: true,
   349  		},
   350  	},
   351  	Metadata: "echoserver.proto",
   352  }
   353  
   354  func init() { proto.RegisterFile("echoserver.proto", fileDescriptor0) }
   355  
   356  var fileDescriptor0 = []byte{
   357  	// 300 bytes of a gzipped FileDescriptorProto
   358  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xc1, 0x4a, 0xc3, 0x40,
   359  	0x10, 0x86, 0xdd, 0x62, 0x13, 0x3a, 0xb5, 0x12, 0x57, 0xc4, 0x50, 0x2a, 0xc8, 0x5e, 0x0c, 0x1e,
   360  	0x92, 0x52, 0x3d, 0x79, 0xaf, 0x08, 0x85, 0x04, 0x52, 0xc4, 0xab, 0xdb, 0x30, 0x24, 0x01, 0x93,
   361  	0x8d, 0xbb, 0xdb, 0x82, 0x57, 0x5f, 0xc1, 0x47, 0xf3, 0x15, 0x7c, 0x07, 0xaf, 0x92, 0xac, 0xc6,
   362  	0x88, 0xa5, 0xc7, 0x99, 0xfd, 0xe6, 0x9f, 0xff, 0xdf, 0x01, 0x07, 0x93, 0x4c, 0x28, 0x94, 0x1b,
   363  	0x94, 0x7e, 0x25, 0x85, 0x16, 0x14, 0x7e, 0x3b, 0xe3, 0x49, 0x2a, 0x44, 0xfa, 0x84, 0x01, 0xaf,
   364  	0xf2, 0x80, 0x97, 0xa5, 0xd0, 0x5c, 0xe7, 0xa2, 0x54, 0x86, 0x64, 0x17, 0x30, 0x9c, 0x27, 0x99,
   365  	0x88, 0xf1, 0x79, 0x8d, 0x4a, 0x53, 0x17, 0xec, 0x02, 0x95, 0xe2, 0x29, 0xba, 0xe4, 0x9c, 0x78,
   366  	0x83, 0xf8, 0xa7, 0x64, 0x1e, 0x1c, 0x18, 0x50, 0x55, 0xa2, 0x54, 0xb8, 0x83, 0x7c, 0x84, 0xc1,
   367  	0x1d, 0x72, 0xa9, 0x57, 0xc8, 0x35, 0xbd, 0x06, 0x4b, 0x69, 0xae, 0xd7, 0xaa, 0xa1, 0x0e, 0x67,
   368  	0x13, 0xbf, 0x63, 0xb6, 0xc5, 0xfc, 0x65, 0xc3, 0xc4, 0xdf, 0x2c, 0x3b, 0x03, 0xcb, 0x74, 0xe8,
   369  	0x10, 0xec, 0xfb, 0x70, 0x11, 0x46, 0x0f, 0xa1, 0xb3, 0x47, 0x2d, 0xe8, 0x45, 0x0b, 0x87, 0x30,
   370  	0x1b, 0xfa, 0xf3, 0xa2, 0xd2, 0x2f, 0xb3, 0x4f, 0x62, 0xec, 0x2f, 0x51, 0x6e, 0xf2, 0x04, 0x69,
   371  	0x04, 0xfb, 0x75, 0x49, 0x4f, 0xbb, 0x5b, 0x3a, 0xf9, 0xc6, 0xee, 0xff, 0x07, 0x93, 0x87, 0x39,
   372  	0xaf, 0xef, 0x1f, 0x6f, 0x3d, 0x60, 0xfd, 0xa0, 0x26, 0x6e, 0xc8, 0xa5, 0x47, 0xa6, 0x84, 0xde,
   373  	0xd6, 0x46, 0x24, 0xf2, 0x82, 0x1e, 0xfd, 0x99, 0xac, 0xb7, 0xef, 0x10, 0x1b, 0x35, 0x62, 0x36,
   374  	0x35, 0x62, 0x53, 0x42, 0x23, 0x80, 0x36, 0xac, 0xda, 0xa6, 0x75, 0xb2, 0xf5, 0x5f, 0xd8, 0x71,
   375  	0x23, 0x34, 0x62, 0xc3, 0x20, 0x6b, 0xc7, 0x6b, 0x63, 0x2b, 0xab, 0x39, 0xdf, 0xd5, 0x57, 0x00,
   376  	0x00, 0x00, 0xff, 0xff, 0xd4, 0x6a, 0xec, 0x7b, 0xfc, 0x01, 0x00, 0x00,
   377  }
   378  

View as plain text