|
@@ -0,0 +1,254 @@
|
|
|
+// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
|
+// source: serverload.proto
|
|
|
+
|
|
|
+//声明 包名
|
|
|
+
|
|
|
+package proto
|
|
|
+
|
|
|
+import (
|
|
|
+ context "context"
|
|
|
+ fmt "fmt"
|
|
|
+ proto "github.com/golang/protobuf/proto"
|
|
|
+ grpc "google.golang.org/grpc"
|
|
|
+ codes "google.golang.org/grpc/codes"
|
|
|
+ status "google.golang.org/grpc/status"
|
|
|
+ math "math"
|
|
|
+)
|
|
|
+
|
|
|
+// 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
|
|
|
+
|
|
|
+//stream请求结构
|
|
|
+type ServerLoadStreamReqData struct {
|
|
|
+ Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
|
|
|
+ Load float64 `protobuf:"fixed64,2,opt,name=load,proto3" json:"load,omitempty"`
|
|
|
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
+ XXX_unrecognized []byte `json:"-"`
|
|
|
+ XXX_sizecache int32 `json:"-"`
|
|
|
+}
|
|
|
+
|
|
|
+func (m *ServerLoadStreamReqData) Reset() { *m = ServerLoadStreamReqData{} }
|
|
|
+func (m *ServerLoadStreamReqData) String() string { return proto.CompactTextString(m) }
|
|
|
+func (*ServerLoadStreamReqData) ProtoMessage() {}
|
|
|
+func (*ServerLoadStreamReqData) Descriptor() ([]byte, []int) {
|
|
|
+ return fileDescriptor_eb77c27475e52076, []int{0}
|
|
|
+}
|
|
|
+
|
|
|
+func (m *ServerLoadStreamReqData) XXX_Unmarshal(b []byte) error {
|
|
|
+ return xxx_messageInfo_ServerLoadStreamReqData.Unmarshal(m, b)
|
|
|
+}
|
|
|
+func (m *ServerLoadStreamReqData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
+ return xxx_messageInfo_ServerLoadStreamReqData.Marshal(b, m, deterministic)
|
|
|
+}
|
|
|
+func (m *ServerLoadStreamReqData) XXX_Merge(src proto.Message) {
|
|
|
+ xxx_messageInfo_ServerLoadStreamReqData.Merge(m, src)
|
|
|
+}
|
|
|
+func (m *ServerLoadStreamReqData) XXX_Size() int {
|
|
|
+ return xxx_messageInfo_ServerLoadStreamReqData.Size(m)
|
|
|
+}
|
|
|
+func (m *ServerLoadStreamReqData) XXX_DiscardUnknown() {
|
|
|
+ xxx_messageInfo_ServerLoadStreamReqData.DiscardUnknown(m)
|
|
|
+}
|
|
|
+
|
|
|
+var xxx_messageInfo_ServerLoadStreamReqData proto.InternalMessageInfo
|
|
|
+
|
|
|
+func (m *ServerLoadStreamReqData) GetIp() string {
|
|
|
+ if m != nil {
|
|
|
+ return m.Ip
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+func (m *ServerLoadStreamReqData) GetLoad() float64 {
|
|
|
+ if m != nil {
|
|
|
+ return m.Load
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+}
|
|
|
+
|
|
|
+//stream返回结构
|
|
|
+type ServerLoadStreamResData struct {
|
|
|
+ Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
|
|
|
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
+ XXX_unrecognized []byte `json:"-"`
|
|
|
+ XXX_sizecache int32 `json:"-"`
|
|
|
+}
|
|
|
+
|
|
|
+func (m *ServerLoadStreamResData) Reset() { *m = ServerLoadStreamResData{} }
|
|
|
+func (m *ServerLoadStreamResData) String() string { return proto.CompactTextString(m) }
|
|
|
+func (*ServerLoadStreamResData) ProtoMessage() {}
|
|
|
+func (*ServerLoadStreamResData) Descriptor() ([]byte, []int) {
|
|
|
+ return fileDescriptor_eb77c27475e52076, []int{1}
|
|
|
+}
|
|
|
+
|
|
|
+func (m *ServerLoadStreamResData) XXX_Unmarshal(b []byte) error {
|
|
|
+ return xxx_messageInfo_ServerLoadStreamResData.Unmarshal(m, b)
|
|
|
+}
|
|
|
+func (m *ServerLoadStreamResData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
+ return xxx_messageInfo_ServerLoadStreamResData.Marshal(b, m, deterministic)
|
|
|
+}
|
|
|
+func (m *ServerLoadStreamResData) XXX_Merge(src proto.Message) {
|
|
|
+ xxx_messageInfo_ServerLoadStreamResData.Merge(m, src)
|
|
|
+}
|
|
|
+func (m *ServerLoadStreamResData) XXX_Size() int {
|
|
|
+ return xxx_messageInfo_ServerLoadStreamResData.Size(m)
|
|
|
+}
|
|
|
+func (m *ServerLoadStreamResData) XXX_DiscardUnknown() {
|
|
|
+ xxx_messageInfo_ServerLoadStreamResData.DiscardUnknown(m)
|
|
|
+}
|
|
|
+
|
|
|
+var xxx_messageInfo_ServerLoadStreamResData proto.InternalMessageInfo
|
|
|
+
|
|
|
+func (m *ServerLoadStreamResData) GetCode() string {
|
|
|
+ if m != nil {
|
|
|
+ return m.Code
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+}
|
|
|
+
|
|
|
+func init() {
|
|
|
+ proto.RegisterType((*ServerLoadStreamReqData)(nil), "proto.ServerLoadStreamReqData")
|
|
|
+ proto.RegisterType((*ServerLoadStreamResData)(nil), "proto.ServerLoadStreamResData")
|
|
|
+}
|
|
|
+
|
|
|
+func init() {
|
|
|
+ proto.RegisterFile("serverload.proto", fileDescriptor_eb77c27475e52076)
|
|
|
+}
|
|
|
+
|
|
|
+var fileDescriptor_eb77c27475e52076 = []byte{
|
|
|
+ // 155 bytes of a gzipped FileDescriptorProto
|
|
|
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x28, 0x4e, 0x2d, 0x2a,
|
|
|
+ 0x4b, 0x2d, 0xca, 0xc9, 0x4f, 0x4c, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53,
|
|
|
+ 0x4a, 0xb6, 0x5c, 0xe2, 0xc1, 0x60, 0x29, 0x9f, 0xfc, 0xc4, 0x94, 0xe0, 0x92, 0xa2, 0xd4, 0xc4,
|
|
|
+ 0xdc, 0xa0, 0xd4, 0x42, 0x97, 0xc4, 0x92, 0x44, 0x21, 0x3e, 0x2e, 0xa6, 0xcc, 0x02, 0x09, 0x46,
|
|
|
+ 0x05, 0x46, 0x0d, 0xce, 0x20, 0xa6, 0xcc, 0x02, 0x21, 0x21, 0x2e, 0x16, 0x90, 0x7e, 0x09, 0x26,
|
|
|
+ 0x05, 0x46, 0x0d, 0xc6, 0x20, 0x30, 0x5b, 0x49, 0x17, 0x9b, 0xf6, 0x62, 0xb0, 0x76, 0x21, 0x2e,
|
|
|
+ 0x96, 0xe4, 0xfc, 0x94, 0x54, 0xa8, 0x01, 0x60, 0xb6, 0x51, 0x2c, 0x17, 0x17, 0x42, 0xb9, 0x90,
|
|
|
+ 0x3f, 0x17, 0x67, 0x40, 0x69, 0x09, 0x44, 0x97, 0x90, 0x1c, 0xc4, 0x5d, 0x7a, 0x38, 0x5c, 0x23,
|
|
|
+ 0x85, 0x5b, 0x1e, 0x6c, 0x9d, 0x12, 0x83, 0x06, 0x63, 0x12, 0x1b, 0x58, 0x89, 0x31, 0x20, 0x00,
|
|
|
+ 0x00, 0xff, 0xff, 0x6a, 0xae, 0x41, 0xc4, 0xee, 0x00, 0x00, 0x00,
|
|
|
+}
|
|
|
+
|
|
|
+// Reference imports to suppress errors if they are not otherwise used.
|
|
|
+var _ context.Context
|
|
|
+var _ grpc.ClientConnInterface
|
|
|
+
|
|
|
+// 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.SupportPackageIsVersion6
|
|
|
+
|
|
|
+// ServerLoadClient is the client API for ServerLoad service.
|
|
|
+//
|
|
|
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
|
+type ServerLoadClient interface {
|
|
|
+ //rpc GetStream (StreamReqData) returns (stream StreamResData){}
|
|
|
+ PutStream(ctx context.Context, opts ...grpc.CallOption) (ServerLoad_PutStreamClient, error)
|
|
|
+}
|
|
|
+
|
|
|
+type serverLoadClient struct {
|
|
|
+ cc grpc.ClientConnInterface
|
|
|
+}
|
|
|
+
|
|
|
+func NewServerLoadClient(cc grpc.ClientConnInterface) ServerLoadClient {
|
|
|
+ return &serverLoadClient{cc}
|
|
|
+}
|
|
|
+
|
|
|
+func (c *serverLoadClient) PutStream(ctx context.Context, opts ...grpc.CallOption) (ServerLoad_PutStreamClient, error) {
|
|
|
+ stream, err := c.cc.NewStream(ctx, &_ServerLoad_serviceDesc.Streams[0], "/proto.ServerLoad/PutStream", opts...)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ x := &serverLoadPutStreamClient{stream}
|
|
|
+ return x, nil
|
|
|
+}
|
|
|
+
|
|
|
+type ServerLoad_PutStreamClient interface {
|
|
|
+ Send(*ServerLoadStreamReqData) error
|
|
|
+ CloseAndRecv() (*ServerLoadStreamResData, error)
|
|
|
+ grpc.ClientStream
|
|
|
+}
|
|
|
+
|
|
|
+type serverLoadPutStreamClient struct {
|
|
|
+ grpc.ClientStream
|
|
|
+}
|
|
|
+
|
|
|
+func (x *serverLoadPutStreamClient) Send(m *ServerLoadStreamReqData) error {
|
|
|
+ return x.ClientStream.SendMsg(m)
|
|
|
+}
|
|
|
+
|
|
|
+func (x *serverLoadPutStreamClient) CloseAndRecv() (*ServerLoadStreamResData, error) {
|
|
|
+ if err := x.ClientStream.CloseSend(); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ m := new(ServerLoadStreamResData)
|
|
|
+ if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return m, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ServerLoadServer is the server API for ServerLoad service.
|
|
|
+type ServerLoadServer interface {
|
|
|
+ //rpc GetStream (StreamReqData) returns (stream StreamResData){}
|
|
|
+ PutStream(ServerLoad_PutStreamServer) error
|
|
|
+}
|
|
|
+
|
|
|
+// UnimplementedServerLoadServer can be embedded to have forward compatible implementations.
|
|
|
+type UnimplementedServerLoadServer struct {
|
|
|
+}
|
|
|
+
|
|
|
+func (*UnimplementedServerLoadServer) PutStream(srv ServerLoad_PutStreamServer) error {
|
|
|
+ return status.Errorf(codes.Unimplemented, "method PutStream not implemented")
|
|
|
+}
|
|
|
+
|
|
|
+func RegisterServerLoadServer(s *grpc.Server, srv ServerLoadServer) {
|
|
|
+ s.RegisterService(&_ServerLoad_serviceDesc, srv)
|
|
|
+}
|
|
|
+
|
|
|
+func _ServerLoad_PutStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
|
+ return srv.(ServerLoadServer).PutStream(&serverLoadPutStreamServer{stream})
|
|
|
+}
|
|
|
+
|
|
|
+type ServerLoad_PutStreamServer interface {
|
|
|
+ SendAndClose(*ServerLoadStreamResData) error
|
|
|
+ Recv() (*ServerLoadStreamReqData, error)
|
|
|
+ grpc.ServerStream
|
|
|
+}
|
|
|
+
|
|
|
+type serverLoadPutStreamServer struct {
|
|
|
+ grpc.ServerStream
|
|
|
+}
|
|
|
+
|
|
|
+func (x *serverLoadPutStreamServer) SendAndClose(m *ServerLoadStreamResData) error {
|
|
|
+ return x.ServerStream.SendMsg(m)
|
|
|
+}
|
|
|
+
|
|
|
+func (x *serverLoadPutStreamServer) Recv() (*ServerLoadStreamReqData, error) {
|
|
|
+ m := new(ServerLoadStreamReqData)
|
|
|
+ if err := x.ServerStream.RecvMsg(m); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return m, nil
|
|
|
+}
|
|
|
+
|
|
|
+var _ServerLoad_serviceDesc = grpc.ServiceDesc{
|
|
|
+ ServiceName: "proto.ServerLoad",
|
|
|
+ HandlerType: (*ServerLoadServer)(nil),
|
|
|
+ Methods: []grpc.MethodDesc{},
|
|
|
+ Streams: []grpc.StreamDesc{
|
|
|
+ {
|
|
|
+ StreamName: "PutStream",
|
|
|
+ Handler: _ServerLoad_PutStream_Handler,
|
|
|
+ ClientStreams: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ Metadata: "serverload.proto",
|
|
|
+}
|