diff --git a/protos/hub/hub.pb.go b/protos/hub/hub.pb.go new file mode 100644 index 0000000..f0c307f --- /dev/null +++ b/protos/hub/hub.pb.go @@ -0,0 +1,3964 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: protos/hub/hub.proto + +package hub + +import ( + context "context" + encoding_binary "encoding/binary" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + _ "github.com/gogo/protobuf/types" + golang_proto "github.com/golang/protobuf/proto" + proto "github.com/tron-us/protobuf/proto" + github_com_tron_us_protobuf_types "github.com/tron-us/protobuf/types" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = golang_proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type ResponseCode int32 + +const ( + ResponseCode_SUCCESS ResponseCode = 0 + ResponseCode_SIGNATURE_FORMAT_ERROR ResponseCode = 1 + ResponseCode_COMPUTE_ADDRESS_ERROR ResponseCode = 2 + ResponseCode_OTHER_ERROR ResponseCode = 20 +) + +var ResponseCode_name = map[int32]string{ + 0: "SUCCESS", + 1: "SIGNATURE_FORMAT_ERROR", + 2: "COMPUTE_ADDRESS_ERROR", + 20: "OTHER_ERROR", +} + +var ResponseCode_value = map[string]int32{ + "SUCCESS": 0, + "SIGNATURE_FORMAT_ERROR": 1, + "COMPUTE_ADDRESS_ERROR": 2, + "OTHER_ERROR": 20, +} + +func (x ResponseCode) String() string { + return proto.EnumName(ResponseCode_name, int32(x)) +} + +func (ResponseCode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_c704b5990190a69f, []int{0} +} + +type SettingsReq struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" pg:"id"` + RespSize int32 `protobuf:"varint,2,opt,name=resp_size,json=respSize,proto3" json:"resp_size,omitempty" pg:"resp_size"` + XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` + XXX_unrecognized []byte `json:"-" pg:"-"` + XXX_sizecache int32 `json:"-" pg:"-"` +} + +func (m *SettingsReq) Reset() { *m = SettingsReq{} } +func (m *SettingsReq) String() string { return proto.CompactTextString(m) } +func (*SettingsReq) ProtoMessage() {} +func (*SettingsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_c704b5990190a69f, []int{0} +} +func (m *SettingsReq) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SettingsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SettingsReq.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SettingsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SettingsReq.Merge(m, src) +} +func (m *SettingsReq) XXX_Size() int { + return m.Size() +} +func (m *SettingsReq) XXX_DiscardUnknown() { + xxx_messageInfo_SettingsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SettingsReq proto.InternalMessageInfo + +func (m *SettingsReq) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *SettingsReq) GetRespSize() int32 { + if m != nil { + return m.RespSize + } + return 0 +} + +func (*SettingsReq) XXX_MessageName() string { + return "hub.SettingsReq" +} + +type SettingsResp struct { + Code ResponseCode `protobuf:"varint,1,opt,name=code,proto3,enum=hub.ResponseCode" json:"code,omitempty" pg:"code"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty" pg:"message"` + ResponseTime time.Time `protobuf:"bytes,3,opt,name=response_time,json=responseTime,proto3,stdtime" json:"response_time" pg:"response_time"` + SettingsData *SettingsData `protobuf:"bytes,4,opt,name=settings_data,json=settingsData,proto3" json:"settings_data,omitempty" pg:"settings_data"` + XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` + XXX_unrecognized []byte `json:"-" pg:"-"` + XXX_sizecache int32 `json:"-" pg:"-"` +} + +func (m *SettingsResp) Reset() { *m = SettingsResp{} } +func (m *SettingsResp) String() string { return proto.CompactTextString(m) } +func (*SettingsResp) ProtoMessage() {} +func (*SettingsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_c704b5990190a69f, []int{1} +} +func (m *SettingsResp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SettingsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SettingsResp.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SettingsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SettingsResp.Merge(m, src) +} +func (m *SettingsResp) XXX_Size() int { + return m.Size() +} +func (m *SettingsResp) XXX_DiscardUnknown() { + xxx_messageInfo_SettingsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SettingsResp proto.InternalMessageInfo + +func (m *SettingsResp) GetCode() ResponseCode { + if m != nil { + return m.Code + } + return ResponseCode_SUCCESS +} + +func (m *SettingsResp) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *SettingsResp) GetResponseTime() time.Time { + if m != nil { + return m.ResponseTime + } + return time.Time{} +} + +func (m *SettingsResp) GetSettingsData() *SettingsData { + if m != nil { + return m.SettingsData + } + return nil +} + +func (*SettingsResp) XXX_MessageName() string { + return "hub.SettingsResp" +} + +type SettingsData struct { + StoragePriceAsk float64 `protobuf:"fixed64,1,opt,name=storage_price_ask,json=storagePriceAsk,proto3" json:"storage_price_ask,omitempty" pg:"storage_price_ask"` + BandwidthPriceAsk float64 `protobuf:"fixed64,2,opt,name=bandwidth_price_ask,json=bandwidthPriceAsk,proto3" json:"bandwidth_price_ask,omitempty" pg:"bandwidth_price_ask"` + StorageTimeMin float64 `protobuf:"fixed64,3,opt,name=storage_time_min,json=storageTimeMin,proto3" json:"storage_time_min,omitempty" pg:"storage_time_min"` + BandwidthLimit float64 `protobuf:"fixed64,4,opt,name=bandwidth_limit,json=bandwidthLimit,proto3" json:"bandwidth_limit,omitempty" pg:"bandwidth_limit"` + CollateralStake float64 `protobuf:"fixed64,5,opt,name=collateral_stake,json=collateralStake,proto3" json:"collateral_stake,omitempty" pg:"collateral_stake"` + XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` + XXX_unrecognized []byte `json:"-" pg:"-"` + XXX_sizecache int32 `json:"-" pg:"-"` +} + +func (m *SettingsData) Reset() { *m = SettingsData{} } +func (m *SettingsData) String() string { return proto.CompactTextString(m) } +func (*SettingsData) ProtoMessage() {} +func (*SettingsData) Descriptor() ([]byte, []int) { + return fileDescriptor_c704b5990190a69f, []int{2} +} +func (m *SettingsData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SettingsData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SettingsData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SettingsData) XXX_Merge(src proto.Message) { + xxx_messageInfo_SettingsData.Merge(m, src) +} +func (m *SettingsData) XXX_Size() int { + return m.Size() +} +func (m *SettingsData) XXX_DiscardUnknown() { + xxx_messageInfo_SettingsData.DiscardUnknown(m) +} + +var xxx_messageInfo_SettingsData proto.InternalMessageInfo + +func (m *SettingsData) GetStoragePriceAsk() float64 { + if m != nil { + return m.StoragePriceAsk + } + return 0 +} + +func (m *SettingsData) GetBandwidthPriceAsk() float64 { + if m != nil { + return m.BandwidthPriceAsk + } + return 0 +} + +func (m *SettingsData) GetStorageTimeMin() float64 { + if m != nil { + return m.StorageTimeMin + } + return 0 +} + +func (m *SettingsData) GetBandwidthLimit() float64 { + if m != nil { + return m.BandwidthLimit + } + return 0 +} + +func (m *SettingsData) GetCollateralStake() float64 { + if m != nil { + return m.CollateralStake + } + return 0 +} + +func (*SettingsData) XXX_MessageName() string { + return "hub.SettingsData" +} + +type HostsReq struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" pg:"id"` + RespSize int32 `protobuf:"varint,2,opt,name=resp_size,json=respSize,proto3" json:"resp_size,omitempty" pg:"resp_size"` + XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` + XXX_unrecognized []byte `json:"-" pg:"-"` + XXX_sizecache int32 `json:"-" pg:"-"` +} + +func (m *HostsReq) Reset() { *m = HostsReq{} } +func (m *HostsReq) String() string { return proto.CompactTextString(m) } +func (*HostsReq) ProtoMessage() {} +func (*HostsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_c704b5990190a69f, []int{3} +} +func (m *HostsReq) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HostsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HostsReq.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HostsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_HostsReq.Merge(m, src) +} +func (m *HostsReq) XXX_Size() int { + return m.Size() +} +func (m *HostsReq) XXX_DiscardUnknown() { + xxx_messageInfo_HostsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_HostsReq proto.InternalMessageInfo + +func (m *HostsReq) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *HostsReq) GetRespSize() int32 { + if m != nil { + return m.RespSize + } + return 0 +} + +func (*HostsReq) XXX_MessageName() string { + return "hub.HostsReq" +} + +type HostsResp struct { + Code ResponseCode `protobuf:"varint,1,opt,name=code,proto3,enum=hub.ResponseCode" json:"code,omitempty" pg:"code"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty" pg:"message"` + Hosts *HostsData `protobuf:"bytes,3,opt,name=hosts,proto3" json:"hosts,omitempty" pg:"hosts"` + RespSize int32 `protobuf:"varint,4,opt,name=resp_size,json=respSize,proto3" json:"resp_size,omitempty" pg:"resp_size"` + Mode string `protobuf:"bytes,5,opt,name=mode,proto3" json:"mode,omitempty" pg:"mode"` + ResponseTime time.Time `protobuf:"bytes,6,opt,name=response_time,json=responseTime,proto3,stdtime" json:"response_time" pg:"response_time"` + XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` + XXX_unrecognized []byte `json:"-" pg:"-"` + XXX_sizecache int32 `json:"-" pg:"-"` +} + +func (m *HostsResp) Reset() { *m = HostsResp{} } +func (m *HostsResp) String() string { return proto.CompactTextString(m) } +func (*HostsResp) ProtoMessage() {} +func (*HostsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_c704b5990190a69f, []int{4} +} +func (m *HostsResp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HostsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HostsResp.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HostsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_HostsResp.Merge(m, src) +} +func (m *HostsResp) XXX_Size() int { + return m.Size() +} +func (m *HostsResp) XXX_DiscardUnknown() { + xxx_messageInfo_HostsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_HostsResp proto.InternalMessageInfo + +func (m *HostsResp) GetCode() ResponseCode { + if m != nil { + return m.Code + } + return ResponseCode_SUCCESS +} + +func (m *HostsResp) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *HostsResp) GetHosts() *HostsData { + if m != nil { + return m.Hosts + } + return nil +} + +func (m *HostsResp) GetRespSize() int32 { + if m != nil { + return m.RespSize + } + return 0 +} + +func (m *HostsResp) GetMode() string { + if m != nil { + return m.Mode + } + return "" +} + +func (m *HostsResp) GetResponseTime() time.Time { + if m != nil { + return m.ResponseTime + } + return time.Time{} +} + +func (*HostsResp) XXX_MessageName() string { + return "hub.HostsResp" +} + +type HostsData struct { + Hosts []*Host `protobuf:"bytes,1,rep,name=hosts,proto3" json:"hosts,omitempty" pg:"hosts"` + XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` + XXX_unrecognized []byte `json:"-" pg:"-"` + XXX_sizecache int32 `json:"-" pg:"-"` +} + +func (m *HostsData) Reset() { *m = HostsData{} } +func (m *HostsData) String() string { return proto.CompactTextString(m) } +func (*HostsData) ProtoMessage() {} +func (*HostsData) Descriptor() ([]byte, []int) { + return fileDescriptor_c704b5990190a69f, []int{5} +} +func (m *HostsData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HostsData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HostsData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HostsData) XXX_Merge(src proto.Message) { + xxx_messageInfo_HostsData.Merge(m, src) +} +func (m *HostsData) XXX_Size() int { + return m.Size() +} +func (m *HostsData) XXX_DiscardUnknown() { + xxx_messageInfo_HostsData.DiscardUnknown(m) +} + +var xxx_messageInfo_HostsData proto.InternalMessageInfo + +func (m *HostsData) GetHosts() []*Host { + if m != nil { + return m.Hosts + } + return nil +} + +func (*HostsData) XXX_MessageName() string { + return "hub.HostsData" +} + +type Host struct { + NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty" pg:"node_id"` + TimeCreate time.Time `protobuf:"bytes,2,opt,name=time_create,json=timeCreate,proto3,stdtime" json:"time_create" pg:"time_create"` + TimeUpdate time.Time `protobuf:"bytes,3,opt,name=time_update,json=timeUpdate,proto3,stdtime" json:"time_update" pg:"time_update"` + NodeIp string `protobuf:"bytes,4,opt,name=node_ip,json=nodeIp,proto3" json:"node_ip,omitempty" pg:"node_ip"` + Region string `protobuf:"bytes,5,opt,name=region,proto3" json:"region,omitempty" pg:"region"` + BtfsVersion string `protobuf:"bytes,6,opt,name=btfs_version,json=btfsVersion,proto3" json:"btfs_version,omitempty" pg:"btfs_version"` + Score float32 `protobuf:"fixed32,7,opt,name=score,proto3" json:"score,omitempty" pg:"score"` + HeartBeats int64 `protobuf:"varint,8,opt,name=heart_beats,json=heartBeats,proto3" json:"heart_beats,omitempty" pg:"heart_beats"` + Uptime float32 `protobuf:"fixed32,9,opt,name=uptime,proto3" json:"uptime,omitempty" pg:"uptime"` + Age int64 `protobuf:"varint,10,opt,name=age,proto3" json:"age,omitempty" pg:"age"` + Reputation float32 `protobuf:"fixed32,11,opt,name=reputation,proto3" json:"reputation,omitempty" pg:"reputation"` + UploadAvg float32 `protobuf:"fixed32,12,opt,name=upload_avg,json=uploadAvg,proto3" json:"upload_avg,omitempty" pg:"upload_avg"` + UploadVar float32 `protobuf:"fixed32,13,opt,name=upload_var,json=uploadVar,proto3" json:"upload_var,omitempty" pg:"upload_var"` + DownloadAvg float32 `protobuf:"fixed32,14,opt,name=download_avg,json=downloadAvg,proto3" json:"download_avg,omitempty" pg:"download_avg"` + DownloadVar float32 `protobuf:"fixed32,15,opt,name=download_var,json=downloadVar,proto3" json:"download_var,omitempty" pg:"download_var"` + Location *Location `protobuf:"bytes,16,opt,name=location,proto3" json:"location,omitempty" pg:"location"` + StorageInfo *StorageInfo `protobuf:"bytes,17,opt,name=storage_info,json=storageInfo,proto3" json:"storage_info,omitempty" pg:"storage_info"` + BandwidthInfo *BandwidthInfo `protobuf:"bytes,18,opt,name=bandwidth_info,json=bandwidthInfo,proto3" json:"bandwidth_info,omitempty" pg:"bandwidth_info"` + CollateralInfo *CollateralInfo `protobuf:"bytes,19,opt,name=collateral_info,json=collateralInfo,proto3" json:"collateral_info,omitempty" pg:"collateral_info"` + XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` + XXX_unrecognized []byte `json:"-" pg:"-"` + XXX_sizecache int32 `json:"-" pg:"-"` +} + +func (m *Host) Reset() { *m = Host{} } +func (m *Host) String() string { return proto.CompactTextString(m) } +func (*Host) ProtoMessage() {} +func (*Host) Descriptor() ([]byte, []int) { + return fileDescriptor_c704b5990190a69f, []int{6} +} +func (m *Host) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Host) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Host.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Host) XXX_Merge(src proto.Message) { + xxx_messageInfo_Host.Merge(m, src) +} +func (m *Host) XXX_Size() int { + return m.Size() +} +func (m *Host) XXX_DiscardUnknown() { + xxx_messageInfo_Host.DiscardUnknown(m) +} + +var xxx_messageInfo_Host proto.InternalMessageInfo + +func (m *Host) GetNodeId() string { + if m != nil { + return m.NodeId + } + return "" +} + +func (m *Host) GetTimeCreate() time.Time { + if m != nil { + return m.TimeCreate + } + return time.Time{} +} + +func (m *Host) GetTimeUpdate() time.Time { + if m != nil { + return m.TimeUpdate + } + return time.Time{} +} + +func (m *Host) GetNodeIp() string { + if m != nil { + return m.NodeIp + } + return "" +} + +func (m *Host) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +func (m *Host) GetBtfsVersion() string { + if m != nil { + return m.BtfsVersion + } + return "" +} + +func (m *Host) GetScore() float32 { + if m != nil { + return m.Score + } + return 0 +} + +func (m *Host) GetHeartBeats() int64 { + if m != nil { + return m.HeartBeats + } + return 0 +} + +func (m *Host) GetUptime() float32 { + if m != nil { + return m.Uptime + } + return 0 +} + +func (m *Host) GetAge() int64 { + if m != nil { + return m.Age + } + return 0 +} + +func (m *Host) GetReputation() float32 { + if m != nil { + return m.Reputation + } + return 0 +} + +func (m *Host) GetUploadAvg() float32 { + if m != nil { + return m.UploadAvg + } + return 0 +} + +func (m *Host) GetUploadVar() float32 { + if m != nil { + return m.UploadVar + } + return 0 +} + +func (m *Host) GetDownloadAvg() float32 { + if m != nil { + return m.DownloadAvg + } + return 0 +} + +func (m *Host) GetDownloadVar() float32 { + if m != nil { + return m.DownloadVar + } + return 0 +} + +func (m *Host) GetLocation() *Location { + if m != nil { + return m.Location + } + return nil +} + +func (m *Host) GetStorageInfo() *StorageInfo { + if m != nil { + return m.StorageInfo + } + return nil +} + +func (m *Host) GetBandwidthInfo() *BandwidthInfo { + if m != nil { + return m.BandwidthInfo + } + return nil +} + +func (m *Host) GetCollateralInfo() *CollateralInfo { + if m != nil { + return m.CollateralInfo + } + return nil +} + +func (*Host) XXX_MessageName() string { + return "hub.Host" +} + +type Location struct { + Lat float64 `protobuf:"fixed64,1,opt,name=lat,proto3" json:"lat,omitempty" pg:"lat"` + Lon float64 `protobuf:"fixed64,2,opt,name=lon,proto3" json:"lon,omitempty" pg:"lon"` + XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` + XXX_unrecognized []byte `json:"-" pg:"-"` + XXX_sizecache int32 `json:"-" pg:"-"` +} + +func (m *Location) Reset() { *m = Location{} } +func (m *Location) String() string { return proto.CompactTextString(m) } +func (*Location) ProtoMessage() {} +func (*Location) Descriptor() ([]byte, []int) { + return fileDescriptor_c704b5990190a69f, []int{7} +} +func (m *Location) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Location) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Location.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Location) XXX_Merge(src proto.Message) { + xxx_messageInfo_Location.Merge(m, src) +} +func (m *Location) XXX_Size() int { + return m.Size() +} +func (m *Location) XXX_DiscardUnknown() { + xxx_messageInfo_Location.DiscardUnknown(m) +} + +var xxx_messageInfo_Location proto.InternalMessageInfo + +func (m *Location) GetLat() float64 { + if m != nil { + return m.Lat + } + return 0 +} + +func (m *Location) GetLon() float64 { + if m != nil { + return m.Lon + } + return 0 +} + +func (*Location) XXX_MessageName() string { + return "hub.Location" +} + +type StorageInfo struct { + StorageCap float32 `protobuf:"fixed32,1,opt,name=storage_cap,json=storageCap,proto3" json:"storage_cap,omitempty" pg:"storage_cap"` + StorageLeft float32 `protobuf:"fixed32,2,opt,name=storage_left,json=storageLeft,proto3" json:"storage_left,omitempty" pg:"storage_left"` + StorageMinTime int64 `protobuf:"varint,3,opt,name=storage_min_time,json=storageMinTime,proto3" json:"storage_min_time,omitempty" pg:"storage_min_time"` + StorageAskPrice float32 `protobuf:"fixed32,4,opt,name=storage_ask_price,json=storageAskPrice,proto3" json:"storage_ask_price,omitempty" pg:"storage_ask_price"` + StoragePriceEst float32 `protobuf:"fixed32,5,opt,name=storage_price_est,json=storagePriceEst,proto3" json:"storage_price_est,omitempty" pg:"storage_price_est"` + XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` + XXX_unrecognized []byte `json:"-" pg:"-"` + XXX_sizecache int32 `json:"-" pg:"-"` +} + +func (m *StorageInfo) Reset() { *m = StorageInfo{} } +func (m *StorageInfo) String() string { return proto.CompactTextString(m) } +func (*StorageInfo) ProtoMessage() {} +func (*StorageInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_c704b5990190a69f, []int{8} +} +func (m *StorageInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StorageInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StorageInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StorageInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_StorageInfo.Merge(m, src) +} +func (m *StorageInfo) XXX_Size() int { + return m.Size() +} +func (m *StorageInfo) XXX_DiscardUnknown() { + xxx_messageInfo_StorageInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_StorageInfo proto.InternalMessageInfo + +func (m *StorageInfo) GetStorageCap() float32 { + if m != nil { + return m.StorageCap + } + return 0 +} + +func (m *StorageInfo) GetStorageLeft() float32 { + if m != nil { + return m.StorageLeft + } + return 0 +} + +func (m *StorageInfo) GetStorageMinTime() int64 { + if m != nil { + return m.StorageMinTime + } + return 0 +} + +func (m *StorageInfo) GetStorageAskPrice() float32 { + if m != nil { + return m.StorageAskPrice + } + return 0 +} + +func (m *StorageInfo) GetStoragePriceEst() float32 { + if m != nil { + return m.StoragePriceEst + } + return 0 +} + +func (*StorageInfo) XXX_MessageName() string { + return "hub.StorageInfo" +} + +type BandwidthInfo struct { + BandwidthLimit float32 `protobuf:"fixed32,1,opt,name=bandwidth_limit,json=bandwidthLimit,proto3" json:"bandwidth_limit,omitempty" pg:"bandwidth_limit"` + BandwidthAskPrice float32 `protobuf:"fixed32,2,opt,name=bandwidth_ask_price,json=bandwidthAskPrice,proto3" json:"bandwidth_ask_price,omitempty" pg:"bandwidth_ask_price"` + BandwidthPriceEst float32 `protobuf:"fixed32,3,opt,name=bandwidth_price_est,json=bandwidthPriceEst,proto3" json:"bandwidth_price_est,omitempty" pg:"bandwidth_price_est"` + XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` + XXX_unrecognized []byte `json:"-" pg:"-"` + XXX_sizecache int32 `json:"-" pg:"-"` +} + +func (m *BandwidthInfo) Reset() { *m = BandwidthInfo{} } +func (m *BandwidthInfo) String() string { return proto.CompactTextString(m) } +func (*BandwidthInfo) ProtoMessage() {} +func (*BandwidthInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_c704b5990190a69f, []int{9} +} +func (m *BandwidthInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BandwidthInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BandwidthInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BandwidthInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_BandwidthInfo.Merge(m, src) +} +func (m *BandwidthInfo) XXX_Size() int { + return m.Size() +} +func (m *BandwidthInfo) XXX_DiscardUnknown() { + xxx_messageInfo_BandwidthInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_BandwidthInfo proto.InternalMessageInfo + +func (m *BandwidthInfo) GetBandwidthLimit() float32 { + if m != nil { + return m.BandwidthLimit + } + return 0 +} + +func (m *BandwidthInfo) GetBandwidthAskPrice() float32 { + if m != nil { + return m.BandwidthAskPrice + } + return 0 +} + +func (m *BandwidthInfo) GetBandwidthPriceEst() float32 { + if m != nil { + return m.BandwidthPriceEst + } + return 0 +} + +func (*BandwidthInfo) XXX_MessageName() string { + return "hub.BandwidthInfo" +} + +type CollateralInfo struct { + CollateralStake float32 `protobuf:"fixed32,1,opt,name=collateral_stake,json=collateralStake,proto3" json:"collateral_stake,omitempty" pg:"collateral_stake"` + CollateralLost float32 `protobuf:"fixed32,2,opt,name=collateral_lost,json=collateralLost,proto3" json:"collateral_lost,omitempty" pg:"collateral_lost"` + CollateralBurn float32 `protobuf:"fixed32,3,opt,name=collateral_burn,json=collateralBurn,proto3" json:"collateral_burn,omitempty" pg:"collateral_burn"` + XXX_NoUnkeyedLiteral struct{} `json:"-" pg:"-"` + XXX_unrecognized []byte `json:"-" pg:"-"` + XXX_sizecache int32 `json:"-" pg:"-"` +} + +func (m *CollateralInfo) Reset() { *m = CollateralInfo{} } +func (m *CollateralInfo) String() string { return proto.CompactTextString(m) } +func (*CollateralInfo) ProtoMessage() {} +func (*CollateralInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_c704b5990190a69f, []int{10} +} +func (m *CollateralInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CollateralInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CollateralInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CollateralInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_CollateralInfo.Merge(m, src) +} +func (m *CollateralInfo) XXX_Size() int { + return m.Size() +} +func (m *CollateralInfo) XXX_DiscardUnknown() { + xxx_messageInfo_CollateralInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_CollateralInfo proto.InternalMessageInfo + +func (m *CollateralInfo) GetCollateralStake() float32 { + if m != nil { + return m.CollateralStake + } + return 0 +} + +func (m *CollateralInfo) GetCollateralLost() float32 { + if m != nil { + return m.CollateralLost + } + return 0 +} + +func (m *CollateralInfo) GetCollateralBurn() float32 { + if m != nil { + return m.CollateralBurn + } + return 0 +} + +func (*CollateralInfo) XXX_MessageName() string { + return "hub.CollateralInfo" +} +func init() { + proto.RegisterEnum("hub.ResponseCode", ResponseCode_name, ResponseCode_value) + golang_proto.RegisterEnum("hub.ResponseCode", ResponseCode_name, ResponseCode_value) + proto.RegisterType((*SettingsReq)(nil), "hub.SettingsReq") + golang_proto.RegisterType((*SettingsReq)(nil), "hub.SettingsReq") + proto.RegisterType((*SettingsResp)(nil), "hub.SettingsResp") + golang_proto.RegisterType((*SettingsResp)(nil), "hub.SettingsResp") + proto.RegisterType((*SettingsData)(nil), "hub.SettingsData") + golang_proto.RegisterType((*SettingsData)(nil), "hub.SettingsData") + proto.RegisterType((*HostsReq)(nil), "hub.HostsReq") + golang_proto.RegisterType((*HostsReq)(nil), "hub.HostsReq") + proto.RegisterType((*HostsResp)(nil), "hub.HostsResp") + golang_proto.RegisterType((*HostsResp)(nil), "hub.HostsResp") + proto.RegisterType((*HostsData)(nil), "hub.HostsData") + golang_proto.RegisterType((*HostsData)(nil), "hub.HostsData") + proto.RegisterType((*Host)(nil), "hub.Host") + golang_proto.RegisterType((*Host)(nil), "hub.Host") + proto.RegisterType((*Location)(nil), "hub.Location") + golang_proto.RegisterType((*Location)(nil), "hub.Location") + proto.RegisterType((*StorageInfo)(nil), "hub.StorageInfo") + golang_proto.RegisterType((*StorageInfo)(nil), "hub.StorageInfo") + proto.RegisterType((*BandwidthInfo)(nil), "hub.BandwidthInfo") + golang_proto.RegisterType((*BandwidthInfo)(nil), "hub.BandwidthInfo") + proto.RegisterType((*CollateralInfo)(nil), "hub.CollateralInfo") + golang_proto.RegisterType((*CollateralInfo)(nil), "hub.CollateralInfo") +} + +func init() { proto.RegisterFile("protos/hub/hub.proto", fileDescriptor_c704b5990190a69f) } +func init() { golang_proto.RegisterFile("protos/hub/hub.proto", fileDescriptor_c704b5990190a69f) } + +var fileDescriptor_c704b5990190a69f = []byte{ + // 1114 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x6e, 0x23, 0xc5, + 0x13, 0xde, 0xb6, 0xe3, 0xc4, 0xae, 0xb1, 0x1d, 0xa7, 0x77, 0x7f, 0xfb, 0x33, 0x41, 0x38, 0xc6, + 0x02, 0xe1, 0x5d, 0x81, 0x23, 0x79, 0xa5, 0x45, 0x20, 0x84, 0x64, 0x3b, 0x26, 0x89, 0x94, 0x90, + 0xa8, 0x9d, 0xec, 0x81, 0xcb, 0xa8, 0xed, 0x69, 0x3b, 0xa3, 0xd8, 0xd3, 0xb3, 0xd3, 0xed, 0xac, + 0xb4, 0xef, 0x80, 0xc4, 0x71, 0x1f, 0x87, 0x63, 0x8e, 0x08, 0xee, 0x2c, 0x4a, 0x2e, 0x9c, 0x78, + 0x06, 0xd4, 0x35, 0x7f, 0x9d, 0xcd, 0x81, 0x45, 0x1c, 0x22, 0x75, 0x7d, 0x55, 0x5f, 0xe5, 0xab, + 0xae, 0x9e, 0x2a, 0xc3, 0x23, 0x3f, 0x90, 0x5a, 0xaa, 0xdd, 0x8b, 0xe5, 0xd8, 0xfc, 0x75, 0xd0, + 0xa4, 0xf9, 0x8b, 0xe5, 0x78, 0xfb, 0x8b, 0x99, 0xab, 0x0d, 0x34, 0x91, 0x8b, 0xdd, 0x99, 0x9c, + 0xc9, 0x5d, 0xf4, 0x8d, 0x97, 0x53, 0xb4, 0xd0, 0xc0, 0x53, 0xc8, 0xd9, 0xde, 0x99, 0x49, 0x39, + 0x9b, 0x8b, 0x34, 0x4a, 0xbb, 0x0b, 0xa1, 0x34, 0x5f, 0xf8, 0x61, 0x40, 0xeb, 0x6b, 0xb0, 0x46, + 0x42, 0x6b, 0xd7, 0x9b, 0x29, 0x26, 0x5e, 0xd2, 0x2a, 0xe4, 0x5c, 0xa7, 0x4e, 0x9a, 0xa4, 0x5d, + 0x62, 0x39, 0xd7, 0xa1, 0x1f, 0x42, 0x29, 0x10, 0xca, 0xb7, 0x95, 0xfb, 0x5a, 0xd4, 0x73, 0x4d, + 0xd2, 0x2e, 0xb0, 0xa2, 0x01, 0x46, 0xee, 0x6b, 0xd1, 0xfa, 0x95, 0x40, 0x39, 0x25, 0x2b, 0x9f, + 0x7e, 0x0a, 0x6b, 0x13, 0xe9, 0x08, 0xe4, 0x57, 0xbb, 0x5b, 0x1d, 0x23, 0xd4, 0x38, 0xa4, 0xa7, + 0xc4, 0x40, 0x3a, 0x82, 0xa1, 0x9b, 0xd6, 0x61, 0x63, 0x21, 0x94, 0xe2, 0xb3, 0x30, 0x65, 0x89, + 0xc5, 0x26, 0x3d, 0x84, 0x4a, 0x10, 0xc5, 0xdb, 0x46, 0x69, 0x3d, 0xdf, 0x24, 0x6d, 0xab, 0xbb, + 0xdd, 0x09, 0xcb, 0xe8, 0xc4, 0x65, 0x74, 0xce, 0xe2, 0x32, 0xfa, 0xc5, 0xeb, 0xdf, 0x77, 0x1e, + 0xfc, 0xf4, 0x76, 0x87, 0xb0, 0x72, 0x4c, 0x35, 0x4e, 0xfa, 0x1c, 0x2a, 0x2a, 0xd2, 0x66, 0x3b, + 0x5c, 0xf3, 0xfa, 0x1a, 0xa6, 0x0a, 0x45, 0xc5, 0xaa, 0xf7, 0xb8, 0xe6, 0xac, 0xac, 0x32, 0x56, + 0xeb, 0xcf, 0x4c, 0x51, 0x06, 0xa0, 0x4f, 0x61, 0x4b, 0x69, 0x19, 0xf0, 0x99, 0xb0, 0xfd, 0xc0, + 0x9d, 0x08, 0x9b, 0xab, 0x4b, 0xac, 0x90, 0xb0, 0xcd, 0xc8, 0x71, 0x6a, 0xf0, 0x9e, 0xba, 0xa4, + 0x1d, 0x78, 0x38, 0xe6, 0x9e, 0xf3, 0xca, 0x75, 0xf4, 0x45, 0x26, 0x3a, 0x87, 0xd1, 0x5b, 0x89, + 0x2b, 0x89, 0x6f, 0x43, 0x2d, 0xce, 0x6d, 0xca, 0xb5, 0x17, 0xae, 0x87, 0x25, 0x13, 0x56, 0x8d, + 0x70, 0x53, 0xcb, 0xb1, 0xeb, 0xd1, 0xcf, 0x60, 0x33, 0xcd, 0x3c, 0x77, 0x17, 0xae, 0xc6, 0x82, + 0x08, 0xab, 0x26, 0xf0, 0x91, 0x41, 0xe9, 0x13, 0xa8, 0x4d, 0xe4, 0x7c, 0xce, 0xb5, 0x08, 0xf8, + 0xdc, 0x56, 0x9a, 0x5f, 0x8a, 0x7a, 0x21, 0x54, 0x9b, 0xe2, 0x23, 0x03, 0xb7, 0xbe, 0x84, 0xe2, + 0x81, 0x54, 0xfa, 0xfd, 0x1b, 0xff, 0x17, 0x81, 0x52, 0xc4, 0xfc, 0x2f, 0xba, 0xfe, 0x09, 0x14, + 0x2e, 0x4c, 0xb6, 0xa8, 0xdb, 0x55, 0xcc, 0x80, 0xf9, 0xb1, 0x3f, 0xa1, 0x73, 0x55, 0xd1, 0xda, + 0xaa, 0x22, 0x4a, 0x61, 0x6d, 0x61, 0x34, 0x14, 0x30, 0x33, 0x9e, 0xdf, 0x7d, 0x4c, 0xeb, 0xff, + 0xf6, 0x31, 0xb5, 0x3e, 0x8f, 0xea, 0xc5, 0x07, 0xb1, 0x13, 0xcb, 0x25, 0xcd, 0x7c, 0xdb, 0xea, + 0x96, 0x12, 0xb9, 0x91, 0xd2, 0xd6, 0xdb, 0x02, 0xac, 0x19, 0x9b, 0xfe, 0x1f, 0x36, 0x3c, 0xe9, + 0x08, 0x3b, 0xb9, 0xd9, 0x75, 0x63, 0x1e, 0x3a, 0x74, 0x08, 0x16, 0xf6, 0x7b, 0x12, 0x08, 0xae, + 0xc3, 0xfb, 0xf8, 0xa7, 0xc2, 0xc0, 0x10, 0x07, 0xc8, 0x4b, 0xd2, 0x2c, 0x7d, 0xc7, 0xa4, 0xc9, + 0xbf, 0x6f, 0x9a, 0x73, 0xe4, 0xa5, 0x32, 0x7d, 0xbc, 0xd7, 0x58, 0xa6, 0x4f, 0x1f, 0xc3, 0x7a, + 0x20, 0x66, 0xae, 0xf4, 0xa2, 0x7b, 0x8d, 0x2c, 0xfa, 0x31, 0x94, 0xc7, 0x7a, 0xaa, 0xec, 0x2b, + 0x11, 0x28, 0xe3, 0x5d, 0x47, 0xaf, 0x65, 0xb0, 0x17, 0x21, 0x44, 0x1f, 0x41, 0x41, 0x4d, 0x64, + 0x20, 0xea, 0x1b, 0x4d, 0xd2, 0xce, 0xb1, 0xd0, 0xa0, 0x3b, 0x60, 0x5d, 0x08, 0x1e, 0x68, 0x7b, + 0x2c, 0xb8, 0x56, 0xf5, 0x62, 0x93, 0xb4, 0xf3, 0x0c, 0x10, 0xea, 0x1b, 0xc4, 0xfc, 0xc7, 0xa5, + 0x8f, 0xcd, 0x2a, 0x21, 0x2f, 0xb2, 0x68, 0x0d, 0xf2, 0xe6, 0xe1, 0x00, 0x12, 0xcc, 0x91, 0x36, + 0x00, 0x02, 0xe1, 0x2f, 0x35, 0xd7, 0x46, 0x81, 0x85, 0xd1, 0x19, 0x84, 0x7e, 0x04, 0xb0, 0xf4, + 0xe7, 0x92, 0x3b, 0x36, 0xbf, 0x9a, 0xd5, 0xcb, 0xe8, 0x2f, 0x85, 0x48, 0xef, 0x6a, 0x96, 0x71, + 0x5f, 0xf1, 0xa0, 0x5e, 0xc9, 0xba, 0x5f, 0xf0, 0xc0, 0x54, 0xe8, 0xc8, 0x57, 0x5e, 0xc2, 0xaf, + 0x62, 0x80, 0x15, 0x63, 0x26, 0x43, 0x36, 0xc4, 0xe4, 0xd8, 0x5c, 0x0d, 0x31, 0x59, 0x9e, 0x40, + 0x71, 0x2e, 0x27, 0xa1, 0xc2, 0x1a, 0x36, 0xa7, 0x82, 0x8f, 0xe5, 0x28, 0x02, 0x59, 0xe2, 0xa6, + 0xcf, 0xa0, 0x1c, 0x4f, 0x02, 0xd7, 0x9b, 0xca, 0xfa, 0x16, 0x86, 0xd7, 0xc2, 0x69, 0x15, 0x3a, + 0x0e, 0xbd, 0xa9, 0x64, 0x96, 0x4a, 0x0d, 0xfa, 0x15, 0xa4, 0x5f, 0x7f, 0x48, 0xa3, 0x48, 0xa3, + 0x48, 0xeb, 0xc7, 0x2e, 0x24, 0x56, 0xc6, 0x59, 0x93, 0x7e, 0x03, 0x99, 0x71, 0x10, 0x72, 0x1f, + 0x22, 0xf7, 0x21, 0x72, 0x07, 0x89, 0x0f, 0xc9, 0xd5, 0xc9, 0x8a, 0xdd, 0xea, 0x40, 0x31, 0xae, + 0xc1, 0xb4, 0x66, 0xce, 0x75, 0x34, 0x11, 0xcd, 0x11, 0x11, 0xe9, 0x45, 0x53, 0xcf, 0x1c, 0x5b, + 0xbf, 0x11, 0xb0, 0x32, 0x55, 0x98, 0x77, 0x10, 0x57, 0x3b, 0xe1, 0x3e, 0x72, 0x73, 0x0c, 0x22, + 0x68, 0xc0, 0x7d, 0x73, 0xb9, 0x71, 0xc0, 0x5c, 0x4c, 0x35, 0xe6, 0xca, 0x25, 0xc5, 0x1f, 0x89, + 0xa9, 0xce, 0xce, 0xce, 0x85, 0xeb, 0xa5, 0xeb, 0x22, 0x9f, 0xcc, 0xce, 0x63, 0xd7, 0xc3, 0x55, + 0x90, 0x99, 0xe0, 0x5c, 0x5d, 0x86, 0x73, 0x19, 0x5f, 0x7a, 0x2e, 0x99, 0xe0, 0x3d, 0x75, 0x89, + 0x43, 0xf9, 0xdd, 0x69, 0x2f, 0x94, 0xc6, 0xd7, 0x9f, 0x5b, 0x9d, 0xf6, 0x43, 0xa5, 0x5b, 0x6f, + 0x08, 0x54, 0x56, 0x2e, 0xf9, 0xbe, 0x29, 0x1d, 0xd6, 0x76, 0x77, 0x4a, 0xaf, 0x2c, 0x8a, 0x54, + 0x54, 0x58, 0x66, 0xba, 0x28, 0x12, 0x59, 0xf7, 0x2c, 0x16, 0x23, 0x2c, 0x7f, 0x27, 0x3e, 0x91, + 0xf6, 0x23, 0x81, 0xea, 0x6a, 0x0f, 0xef, 0x5d, 0x0c, 0xa1, 0xb8, 0xbb, 0x8b, 0xc1, 0x94, 0x91, + 0x09, 0x9d, 0x4b, 0x15, 0x37, 0x20, 0xf3, 0x0e, 0x8e, 0xcc, 0x80, 0x5b, 0x0d, 0x1c, 0x2f, 0x03, + 0x2f, 0x92, 0x94, 0x09, 0xec, 0x2f, 0x03, 0xef, 0xe9, 0x04, 0xca, 0xd9, 0x95, 0x40, 0x2d, 0xd8, + 0x18, 0x9d, 0x0f, 0x06, 0xc3, 0xd1, 0xa8, 0xf6, 0x80, 0x6e, 0xc3, 0xe3, 0xd1, 0xe1, 0xfe, 0xf7, + 0xbd, 0xb3, 0x73, 0x36, 0xb4, 0xbf, 0x3b, 0x61, 0xc7, 0xbd, 0x33, 0x7b, 0xc8, 0xd8, 0x09, 0xab, + 0x11, 0xfa, 0x01, 0xfc, 0x6f, 0x70, 0x72, 0x7c, 0x7a, 0x7e, 0x36, 0xb4, 0x7b, 0x7b, 0x7b, 0x6c, + 0x38, 0x1a, 0x45, 0xae, 0x1c, 0xdd, 0x04, 0xeb, 0xe4, 0xec, 0x60, 0xc8, 0x22, 0xe0, 0x51, 0xf7, + 0x5b, 0x28, 0xc6, 0x9b, 0x9b, 0x76, 0xc1, 0xda, 0x17, 0x3a, 0x31, 0x6b, 0x2b, 0x6b, 0x9f, 0x89, + 0x97, 0xdb, 0x5b, 0x77, 0x10, 0xe5, 0x77, 0xbb, 0x50, 0xc0, 0x29, 0x6f, 0xbe, 0xdb, 0x7d, 0xa1, + 0xc3, 0x73, 0x25, 0xdd, 0x46, 0x86, 0x56, 0xcd, 0x9a, 0xca, 0xef, 0x3f, 0xbf, 0xbe, 0x69, 0x90, + 0x5f, 0x6e, 0x1a, 0xe4, 0x8f, 0x9b, 0x06, 0x79, 0x73, 0xdb, 0x20, 0x3f, 0xdf, 0x36, 0xc8, 0xf5, + 0x6d, 0x83, 0x80, 0xe5, 0xca, 0x8e, 0x99, 0x88, 0x86, 0xd0, 0x2f, 0x1e, 0x2c, 0xc7, 0xa7, 0x66, + 0x1e, 0x9f, 0x92, 0x1f, 0xcc, 0xef, 0xb8, 0xf1, 0x3a, 0x4e, 0xe7, 0x67, 0x7f, 0x07, 0x00, 0x00, + 0xff, 0xff, 0x6c, 0x10, 0x7f, 0x88, 0xeb, 0x09, 0x00, 0x00, +} + +// 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 + +// SettingsClient is the client API for Settings service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type SettingsClient interface { + GetSettings(ctx context.Context, in *SettingsReq, opts ...grpc.CallOption) (*SettingsResp, error) +} + +type settingsClient struct { + cc *grpc.ClientConn +} + +func NewSettingsClient(cc *grpc.ClientConn) SettingsClient { + return &settingsClient{cc} +} + +func (c *settingsClient) GetSettings(ctx context.Context, in *SettingsReq, opts ...grpc.CallOption) (*SettingsResp, error) { + out := new(SettingsResp) + err := c.cc.Invoke(ctx, "/hub.Settings/GetSettings", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SettingsServer is the server API for Settings service. +type SettingsServer interface { + GetSettings(context.Context, *SettingsReq) (*SettingsResp, error) +} + +// UnimplementedSettingsServer can be embedded to have forward compatible implementations. +type UnimplementedSettingsServer struct { +} + +func (*UnimplementedSettingsServer) GetSettings(ctx context.Context, req *SettingsReq) (*SettingsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSettings not implemented") +} + +func RegisterSettingsServer(s *grpc.Server, srv SettingsServer) { + s.RegisterService(&_Settings_serviceDesc, srv) +} + +func _Settings_GetSettings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SettingsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SettingsServer).GetSettings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/hub.Settings/GetSettings", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SettingsServer).GetSettings(ctx, req.(*SettingsReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _Settings_serviceDesc = grpc.ServiceDesc{ + ServiceName: "hub.Settings", + HandlerType: (*SettingsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetSettings", + Handler: _Settings_GetSettings_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "protos/hub/hub.proto", +} + +// HostsClient is the client API for Hosts service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type HostsClient interface { + GetHosts(ctx context.Context, in *HostsReq, opts ...grpc.CallOption) (*HostsResp, error) +} + +type hostsClient struct { + cc *grpc.ClientConn +} + +func NewHostsClient(cc *grpc.ClientConn) HostsClient { + return &hostsClient{cc} +} + +func (c *hostsClient) GetHosts(ctx context.Context, in *HostsReq, opts ...grpc.CallOption) (*HostsResp, error) { + out := new(HostsResp) + err := c.cc.Invoke(ctx, "/hub.Hosts/GetHosts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// HostsServer is the server API for Hosts service. +type HostsServer interface { + GetHosts(context.Context, *HostsReq) (*HostsResp, error) +} + +// UnimplementedHostsServer can be embedded to have forward compatible implementations. +type UnimplementedHostsServer struct { +} + +func (*UnimplementedHostsServer) GetHosts(ctx context.Context, req *HostsReq) (*HostsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetHosts not implemented") +} + +func RegisterHostsServer(s *grpc.Server, srv HostsServer) { + s.RegisterService(&_Hosts_serviceDesc, srv) +} + +func _Hosts_GetHosts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HostsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HostsServer).GetHosts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/hub.Hosts/GetHosts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HostsServer).GetHosts(ctx, req.(*HostsReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _Hosts_serviceDesc = grpc.ServiceDesc{ + ServiceName: "hub.Hosts", + HandlerType: (*HostsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetHosts", + Handler: _Hosts_GetHosts_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "protos/hub/hub.proto", +} + +func (m *SettingsReq) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SettingsReq) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SettingsReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.RespSize != 0 { + i = encodeVarintHub(dAtA, i, uint64(m.RespSize)) + i-- + dAtA[i] = 0x10 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintHub(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SettingsResp) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SettingsResp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SettingsResp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.SettingsData != nil { + { + size, err := m.SettingsData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHub(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + n2, err2 := github_com_tron_us_protobuf_types.StdTimeMarshalTo(m.ResponseTime, dAtA[i-github_com_tron_us_protobuf_types.SizeOfStdTime(m.ResponseTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintHub(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x1a + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintHub(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x12 + } + if m.Code != 0 { + i = encodeVarintHub(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SettingsData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SettingsData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SettingsData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.CollateralStake != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.CollateralStake)))) + i-- + dAtA[i] = 0x29 + } + if m.BandwidthLimit != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.BandwidthLimit)))) + i-- + dAtA[i] = 0x21 + } + if m.StorageTimeMin != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.StorageTimeMin)))) + i-- + dAtA[i] = 0x19 + } + if m.BandwidthPriceAsk != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.BandwidthPriceAsk)))) + i-- + dAtA[i] = 0x11 + } + if m.StoragePriceAsk != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.StoragePriceAsk)))) + i-- + dAtA[i] = 0x9 + } + return len(dAtA) - i, nil +} + +func (m *HostsReq) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HostsReq) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HostsReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.RespSize != 0 { + i = encodeVarintHub(dAtA, i, uint64(m.RespSize)) + i-- + dAtA[i] = 0x10 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintHub(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HostsResp) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HostsResp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HostsResp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + n3, err3 := github_com_tron_us_protobuf_types.StdTimeMarshalTo(m.ResponseTime, dAtA[i-github_com_tron_us_protobuf_types.SizeOfStdTime(m.ResponseTime):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintHub(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x32 + if len(m.Mode) > 0 { + i -= len(m.Mode) + copy(dAtA[i:], m.Mode) + i = encodeVarintHub(dAtA, i, uint64(len(m.Mode))) + i-- + dAtA[i] = 0x2a + } + if m.RespSize != 0 { + i = encodeVarintHub(dAtA, i, uint64(m.RespSize)) + i-- + dAtA[i] = 0x20 + } + if m.Hosts != nil { + { + size, err := m.Hosts.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHub(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintHub(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x12 + } + if m.Code != 0 { + i = encodeVarintHub(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *HostsData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HostsData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HostsData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Hosts) > 0 { + for iNdEx := len(m.Hosts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Hosts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHub(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Host) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Host) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Host) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.CollateralInfo != nil { + { + size, err := m.CollateralInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHub(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if m.BandwidthInfo != nil { + { + size, err := m.BandwidthInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHub(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if m.StorageInfo != nil { + { + size, err := m.StorageInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHub(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if m.Location != nil { + { + size, err := m.Location.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintHub(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if m.DownloadVar != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.DownloadVar)))) + i-- + dAtA[i] = 0x7d + } + if m.DownloadAvg != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.DownloadAvg)))) + i-- + dAtA[i] = 0x75 + } + if m.UploadVar != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.UploadVar)))) + i-- + dAtA[i] = 0x6d + } + if m.UploadAvg != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.UploadAvg)))) + i-- + dAtA[i] = 0x65 + } + if m.Reputation != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Reputation)))) + i-- + dAtA[i] = 0x5d + } + if m.Age != 0 { + i = encodeVarintHub(dAtA, i, uint64(m.Age)) + i-- + dAtA[i] = 0x50 + } + if m.Uptime != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Uptime)))) + i-- + dAtA[i] = 0x4d + } + if m.HeartBeats != 0 { + i = encodeVarintHub(dAtA, i, uint64(m.HeartBeats)) + i-- + dAtA[i] = 0x40 + } + if m.Score != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Score)))) + i-- + dAtA[i] = 0x3d + } + if len(m.BtfsVersion) > 0 { + i -= len(m.BtfsVersion) + copy(dAtA[i:], m.BtfsVersion) + i = encodeVarintHub(dAtA, i, uint64(len(m.BtfsVersion))) + i-- + dAtA[i] = 0x32 + } + if len(m.Region) > 0 { + i -= len(m.Region) + copy(dAtA[i:], m.Region) + i = encodeVarintHub(dAtA, i, uint64(len(m.Region))) + i-- + dAtA[i] = 0x2a + } + if len(m.NodeIp) > 0 { + i -= len(m.NodeIp) + copy(dAtA[i:], m.NodeIp) + i = encodeVarintHub(dAtA, i, uint64(len(m.NodeIp))) + i-- + dAtA[i] = 0x22 + } + n9, err9 := github_com_tron_us_protobuf_types.StdTimeMarshalTo(m.TimeUpdate, dAtA[i-github_com_tron_us_protobuf_types.SizeOfStdTime(m.TimeUpdate):]) + if err9 != nil { + return 0, err9 + } + i -= n9 + i = encodeVarintHub(dAtA, i, uint64(n9)) + i-- + dAtA[i] = 0x1a + n10, err10 := github_com_tron_us_protobuf_types.StdTimeMarshalTo(m.TimeCreate, dAtA[i-github_com_tron_us_protobuf_types.SizeOfStdTime(m.TimeCreate):]) + if err10 != nil { + return 0, err10 + } + i -= n10 + i = encodeVarintHub(dAtA, i, uint64(n10)) + i-- + dAtA[i] = 0x12 + if len(m.NodeId) > 0 { + i -= len(m.NodeId) + copy(dAtA[i:], m.NodeId) + i = encodeVarintHub(dAtA, i, uint64(len(m.NodeId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Location) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Location) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Location) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Lon != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Lon)))) + i-- + dAtA[i] = 0x11 + } + if m.Lat != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Lat)))) + i-- + dAtA[i] = 0x9 + } + return len(dAtA) - i, nil +} + +func (m *StorageInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StorageInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StorageInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.StoragePriceEst != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.StoragePriceEst)))) + i-- + dAtA[i] = 0x2d + } + if m.StorageAskPrice != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.StorageAskPrice)))) + i-- + dAtA[i] = 0x25 + } + if m.StorageMinTime != 0 { + i = encodeVarintHub(dAtA, i, uint64(m.StorageMinTime)) + i-- + dAtA[i] = 0x18 + } + if m.StorageLeft != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.StorageLeft)))) + i-- + dAtA[i] = 0x15 + } + if m.StorageCap != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.StorageCap)))) + i-- + dAtA[i] = 0xd + } + return len(dAtA) - i, nil +} + +func (m *BandwidthInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BandwidthInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BandwidthInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.BandwidthPriceEst != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.BandwidthPriceEst)))) + i-- + dAtA[i] = 0x1d + } + if m.BandwidthAskPrice != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.BandwidthAskPrice)))) + i-- + dAtA[i] = 0x15 + } + if m.BandwidthLimit != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.BandwidthLimit)))) + i-- + dAtA[i] = 0xd + } + return len(dAtA) - i, nil +} + +func (m *CollateralInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CollateralInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CollateralInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.CollateralBurn != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.CollateralBurn)))) + i-- + dAtA[i] = 0x1d + } + if m.CollateralLost != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.CollateralLost)))) + i-- + dAtA[i] = 0x15 + } + if m.CollateralStake != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.CollateralStake)))) + i-- + dAtA[i] = 0xd + } + return len(dAtA) - i, nil +} + +func encodeVarintHub(dAtA []byte, offset int, v uint64) int { + offset -= sovHub(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SettingsReq) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovHub(uint64(l)) + } + if m.RespSize != 0 { + n += 1 + sovHub(uint64(m.RespSize)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SettingsResp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Code != 0 { + n += 1 + sovHub(uint64(m.Code)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovHub(uint64(l)) + } + l = github_com_tron_us_protobuf_types.SizeOfStdTime(m.ResponseTime) + n += 1 + l + sovHub(uint64(l)) + if m.SettingsData != nil { + l = m.SettingsData.Size() + n += 1 + l + sovHub(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SettingsData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StoragePriceAsk != 0 { + n += 9 + } + if m.BandwidthPriceAsk != 0 { + n += 9 + } + if m.StorageTimeMin != 0 { + n += 9 + } + if m.BandwidthLimit != 0 { + n += 9 + } + if m.CollateralStake != 0 { + n += 9 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *HostsReq) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovHub(uint64(l)) + } + if m.RespSize != 0 { + n += 1 + sovHub(uint64(m.RespSize)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *HostsResp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Code != 0 { + n += 1 + sovHub(uint64(m.Code)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovHub(uint64(l)) + } + if m.Hosts != nil { + l = m.Hosts.Size() + n += 1 + l + sovHub(uint64(l)) + } + if m.RespSize != 0 { + n += 1 + sovHub(uint64(m.RespSize)) + } + l = len(m.Mode) + if l > 0 { + n += 1 + l + sovHub(uint64(l)) + } + l = github_com_tron_us_protobuf_types.SizeOfStdTime(m.ResponseTime) + n += 1 + l + sovHub(uint64(l)) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *HostsData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Hosts) > 0 { + for _, e := range m.Hosts { + l = e.Size() + n += 1 + l + sovHub(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Host) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NodeId) + if l > 0 { + n += 1 + l + sovHub(uint64(l)) + } + l = github_com_tron_us_protobuf_types.SizeOfStdTime(m.TimeCreate) + n += 1 + l + sovHub(uint64(l)) + l = github_com_tron_us_protobuf_types.SizeOfStdTime(m.TimeUpdate) + n += 1 + l + sovHub(uint64(l)) + l = len(m.NodeIp) + if l > 0 { + n += 1 + l + sovHub(uint64(l)) + } + l = len(m.Region) + if l > 0 { + n += 1 + l + sovHub(uint64(l)) + } + l = len(m.BtfsVersion) + if l > 0 { + n += 1 + l + sovHub(uint64(l)) + } + if m.Score != 0 { + n += 5 + } + if m.HeartBeats != 0 { + n += 1 + sovHub(uint64(m.HeartBeats)) + } + if m.Uptime != 0 { + n += 5 + } + if m.Age != 0 { + n += 1 + sovHub(uint64(m.Age)) + } + if m.Reputation != 0 { + n += 5 + } + if m.UploadAvg != 0 { + n += 5 + } + if m.UploadVar != 0 { + n += 5 + } + if m.DownloadAvg != 0 { + n += 5 + } + if m.DownloadVar != 0 { + n += 5 + } + if m.Location != nil { + l = m.Location.Size() + n += 2 + l + sovHub(uint64(l)) + } + if m.StorageInfo != nil { + l = m.StorageInfo.Size() + n += 2 + l + sovHub(uint64(l)) + } + if m.BandwidthInfo != nil { + l = m.BandwidthInfo.Size() + n += 2 + l + sovHub(uint64(l)) + } + if m.CollateralInfo != nil { + l = m.CollateralInfo.Size() + n += 2 + l + sovHub(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Location) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Lat != 0 { + n += 9 + } + if m.Lon != 0 { + n += 9 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *StorageInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StorageCap != 0 { + n += 5 + } + if m.StorageLeft != 0 { + n += 5 + } + if m.StorageMinTime != 0 { + n += 1 + sovHub(uint64(m.StorageMinTime)) + } + if m.StorageAskPrice != 0 { + n += 5 + } + if m.StoragePriceEst != 0 { + n += 5 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *BandwidthInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BandwidthLimit != 0 { + n += 5 + } + if m.BandwidthAskPrice != 0 { + n += 5 + } + if m.BandwidthPriceEst != 0 { + n += 5 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *CollateralInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CollateralStake != 0 { + n += 5 + } + if m.CollateralLost != 0 { + n += 5 + } + if m.CollateralBurn != 0 { + n += 5 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovHub(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozHub(x uint64) (n int) { + return sovHub(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SettingsReq) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SettingsReq: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SettingsReq: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RespSize", wireType) + } + m.RespSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RespSize |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipHub(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SettingsResp) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SettingsResp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SettingsResp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + m.Code = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Code |= ResponseCode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_tron_us_protobuf_types.StdTimeUnmarshal(&m.ResponseTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SettingsData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SettingsData == nil { + m.SettingsData = &SettingsData{} + } + if err := m.SettingsData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHub(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SettingsData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SettingsData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SettingsData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field StoragePriceAsk", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.StoragePriceAsk = float64(math.Float64frombits(v)) + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field BandwidthPriceAsk", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.BandwidthPriceAsk = float64(math.Float64frombits(v)) + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageTimeMin", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.StorageTimeMin = float64(math.Float64frombits(v)) + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field BandwidthLimit", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.BandwidthLimit = float64(math.Float64frombits(v)) + case 5: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralStake", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.CollateralStake = float64(math.Float64frombits(v)) + default: + iNdEx = preIndex + skippy, err := skipHub(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HostsReq) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HostsReq: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HostsReq: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RespSize", wireType) + } + m.RespSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RespSize |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipHub(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HostsResp) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HostsResp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HostsResp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + m.Code = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Code |= ResponseCode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hosts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Hosts == nil { + m.Hosts = &HostsData{} + } + if err := m.Hosts.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RespSize", wireType) + } + m.RespSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RespSize |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Mode = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_tron_us_protobuf_types.StdTimeUnmarshal(&m.ResponseTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHub(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HostsData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HostsData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HostsData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hosts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hosts = append(m.Hosts, &Host{}) + if err := m.Hosts[len(m.Hosts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHub(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Host) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Host: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Host: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodeId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeCreate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_tron_us_protobuf_types.StdTimeUnmarshal(&m.TimeCreate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeUpdate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_tron_us_protobuf_types.StdTimeUnmarshal(&m.TimeUpdate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeIp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodeIp = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Region", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Region = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BtfsVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BtfsVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field Score", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.Score = float32(math.Float32frombits(v)) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HeartBeats", wireType) + } + m.HeartBeats = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HeartBeats |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field Uptime", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.Uptime = float32(math.Float32frombits(v)) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Age", wireType) + } + m.Age = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Age |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field Reputation", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.Reputation = float32(math.Float32frombits(v)) + case 12: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field UploadAvg", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.UploadAvg = float32(math.Float32frombits(v)) + case 13: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field UploadVar", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.UploadVar = float32(math.Float32frombits(v)) + case 14: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field DownloadAvg", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.DownloadAvg = float32(math.Float32frombits(v)) + case 15: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field DownloadVar", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.DownloadVar = float32(math.Float32frombits(v)) + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Location", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Location == nil { + m.Location = &Location{} + } + if err := m.Location.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StorageInfo == nil { + m.StorageInfo = &StorageInfo{} + } + if err := m.StorageInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BandwidthInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BandwidthInfo == nil { + m.BandwidthInfo = &BandwidthInfo{} + } + if err := m.BandwidthInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHub + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHub + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CollateralInfo == nil { + m.CollateralInfo = &CollateralInfo{} + } + if err := m.CollateralInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHub(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Location) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Location: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Location: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Lat", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Lat = float64(math.Float64frombits(v)) + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Lon", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Lon = float64(math.Float64frombits(v)) + default: + iNdEx = preIndex + skippy, err := skipHub(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StorageInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageCap", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.StorageCap = float32(math.Float32frombits(v)) + case 2: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageLeft", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.StorageLeft = float32(math.Float32frombits(v)) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageMinTime", wireType) + } + m.StorageMinTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StorageMinTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field StorageAskPrice", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.StorageAskPrice = float32(math.Float32frombits(v)) + case 5: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field StoragePriceEst", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.StoragePriceEst = float32(math.Float32frombits(v)) + default: + iNdEx = preIndex + skippy, err := skipHub(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BandwidthInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BandwidthInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BandwidthInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field BandwidthLimit", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.BandwidthLimit = float32(math.Float32frombits(v)) + case 2: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field BandwidthAskPrice", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.BandwidthAskPrice = float32(math.Float32frombits(v)) + case 3: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field BandwidthPriceEst", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.BandwidthPriceEst = float32(math.Float32frombits(v)) + default: + iNdEx = preIndex + skippy, err := skipHub(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CollateralInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHub + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CollateralInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CollateralInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralStake", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.CollateralStake = float32(math.Float32frombits(v)) + case 2: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralLost", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.CollateralLost = float32(math.Float32frombits(v)) + case 3: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralBurn", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.CollateralBurn = float32(math.Float32frombits(v)) + default: + iNdEx = preIndex + skippy, err := skipHub(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthHub + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipHub(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowHub + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowHub + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowHub + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthHub + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupHub + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthHub + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthHub = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowHub = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupHub = fmt.Errorf("proto: unexpected end of group") +) diff --git a/protos/hub/hub.proto b/protos/hub/hub.proto new file mode 100644 index 0000000..093125e --- /dev/null +++ b/protos/hub/hub.proto @@ -0,0 +1,132 @@ +syntax = "proto3"; + +package hub; + +// gogo plugin toggles +option (gogoproto.gogoproto_import) = true; +option (gogoproto.goproto_registration) = true; +option (gogoproto.marshaler_all) = true; +option (gogoproto.messagename_all) = true; +option (gogoproto.sizer_all) = true; +option (gogoproto.unmarshaler_all) = true; +// golang option +option go_package = "hub"; +// java options +option java_multiple_files = true; +option java_outer_classname = "HubProto"; +option java_package = "io.btfs.hub"; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +service Settings { + rpc GetSettings(SettingsReq) returns (SettingsResp); +} + +service Hosts { + rpc GetHosts(HostsReq) returns (HostsResp); +} + +message SettingsReq { + string id = 1; + int32 resp_size = 2; +} + +enum ResponseCode { + SUCCESS = 0; + SIGNATURE_FORMAT_ERROR = 1; + COMPUTE_ADDRESS_ERROR = 2; + OTHER_ERROR = 20; +} + +message SettingsResp { + ResponseCode code = 1; + string message = 2; + google.protobuf.Timestamp response_time = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; + SettingsData settings_data = 4; +} + +message SettingsData { + double storage_price_ask = 1; + double bandwidth_price_ask = 2; + double storage_time_min = 3; + double bandwidth_limit = 4; + double collateral_stake = 5; +} + +message HostsReq { + string id = 1; + int32 resp_size = 2; +} + +message HostsResp { + ResponseCode code = 1; + string message = 2; + HostsData hosts = 3; + int32 resp_size = 4; + string mode = 5; + google.protobuf.Timestamp response_time = 6 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; +} + +message HostsData { + repeated Host hosts = 1; +} + +message Host { + string node_id = 1; + google.protobuf.Timestamp time_create = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; + google.protobuf.Timestamp time_update = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true + ]; + string node_ip = 4; + string region = 5; + string btfs_version = 6; + float score = 7; + int64 heart_beats = 8; + float uptime = 9; + int64 age = 10; + float reputation = 11; + float upload_avg = 12; + float upload_var = 13; + float download_avg = 14; + float download_var = 15; + Location location = 16; + StorageInfo storage_info = 17; + BandwidthInfo bandwidth_info = 18; + CollateralInfo collateral_info = 19; +} + +message Location { + double lat = 1; + double lon = 2; +} + +message StorageInfo { + float storage_cap = 1; + float storage_left = 2; + int64 storage_min_time = 3; + float storage_ask_price = 4; + float storage_price_est = 5; +} + +message BandwidthInfo { + float bandwidth_limit = 1; + float bandwidth_ask_price = 2; + float bandwidth_price_est = 3; +} + +message CollateralInfo { + float collateral_stake = 1; + float collateral_lost = 2; + float collateral_burn = 3; +} diff --git a/protos/node/node.pb.go b/protos/node/node.pb.go index c2ec03c..e7479b2 100644 --- a/protos/node/node.pb.go +++ b/protos/node/node.pb.go @@ -31,7 +31,7 @@ var _ = time.Kitchen const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Node struct { - TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty" pg:"table_name" pg:"node_metrics,alias:t,discard_unknown_columns"` + tableName string `pg:"node_metrics,alias:t,discard_unknown_columns"` NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty" pg:"node_id"` BtfsVersion string `protobuf:"bytes,3,opt,name=btfs_version,json=btfsVersion,proto3" json:"btfs_version,omitempty" pg:"btfs_version"` UpTime uint64 `protobuf:"varint,4,opt,name=up_time,json=upTime,proto3" json:"up_time,omitempty" pg:"up_time"` @@ -93,9 +93,9 @@ func (m *Node) XXX_DiscardUnknown() { var xxx_messageInfo_Node proto.InternalMessageInfo -func (m *Node) GetTableName() string { +func (m *Node) GettableName() string { if m != nil { - return m.TableName + return m.tableName } return "" } @@ -582,10 +582,10 @@ func (m *Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.TableName) > 0 { - i -= len(m.TableName) - copy(dAtA[i:], m.TableName) - i = encodeVarintNode(dAtA, i, uint64(len(m.TableName))) + if len(m.tableName) > 0 { + i -= len(m.tableName) + copy(dAtA[i:], m.tableName) + i = encodeVarintNode(dAtA, i, uint64(len(m.tableName))) i-- dAtA[i] = 0xa } @@ -658,7 +658,7 @@ func encodeVarintNode(dAtA []byte, offset int, v uint64) int { } func NewPopulatedNode(r randyNode, easy bool) *Node { this := &Node{} - this.TableName = string(randStringNode(r)) + this.tableName = string(randStringNode(r)) this.NodeId = string(randStringNode(r)) this.BtfsVersion = string(randStringNode(r)) this.UpTime = uint64(uint64(r.Uint32())) @@ -790,7 +790,7 @@ func (m *Node) Size() (n int) { } var l int _ = l - l = len(m.TableName) + l = len(m.tableName) if l > 0 { n += 1 + l + sovNode(uint64(l)) } @@ -937,7 +937,7 @@ func (m *Node) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field tableName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -965,7 +965,7 @@ func (m *Node) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TableName = string(dAtA[iNdEx:postIndex]) + m.tableName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { diff --git a/protos/status/status.pb.go b/protos/status/status.pb.go index f587c3d..c9aa418 100644 --- a/protos/status/status.pb.go +++ b/protos/status/status.pb.go @@ -102,7 +102,7 @@ func (*SignedMetrics) XXX_MessageName() string { } type NodeHealth struct { - TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty" pg:"table_name" pg:"health_monitoring,alias:t,discard_unknown_columns"` + tableName string `pg:"health_monitoring,alias:t,discard_unknown_columns"` NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty" pg:"node_id"` BtfsVersion string `protobuf:"bytes,3,opt,name=btfs_version,json=btfsVersion,proto3" json:"btfs_version,omitempty" pg:"btfs_version"` FailurePoint string `protobuf:"bytes,4,opt,name=failure_point,json=failurePoint,proto3" json:"failure_point,omitempty" pg:"failure_point"` @@ -145,9 +145,9 @@ func (m *NodeHealth) XXX_DiscardUnknown() { var xxx_messageInfo_NodeHealth proto.InternalMessageInfo -func (m *NodeHealth) GetTableName() string { +func (m *NodeHealth) GettableName() string { if m != nil { - return m.TableName + return m.tableName } return "" } @@ -185,7 +185,7 @@ func (*NodeHealth) XXX_MessageName() string { } type NodeError struct { - TableName string `protobuf:"bytes,1,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty" pg:"table_name" pg:"test_error,alias:t,discard_unknown_columns"` + tableName string `pg:"test_error,alias:t,discard_unknown_columns"` HVal string `protobuf:"bytes,2,opt,name=h_val,json=hVal,proto3" json:"h_val,omitempty" pg:"h_val"` PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty" pg:"peer_id"` ErrorStatus string `protobuf:"bytes,4,opt,name=error_status,json=errorStatus,proto3" json:"error_status,omitempty" pg:"error_status"` @@ -228,9 +228,9 @@ func (m *NodeError) XXX_DiscardUnknown() { var xxx_messageInfo_NodeError proto.InternalMessageInfo -func (m *NodeError) GetTableName() string { +func (m *NodeError) GettableName() string { if m != nil { - return m.TableName + return m.tableName } return "" } @@ -688,10 +688,10 @@ func (m *NodeHealth) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.TableName) > 0 { - i -= len(m.TableName) - copy(dAtA[i:], m.TableName) - i = encodeVarintStatus(dAtA, i, uint64(len(m.TableName))) + if len(m.tableName) > 0 { + i -= len(m.tableName) + copy(dAtA[i:], m.tableName) + i = encodeVarintStatus(dAtA, i, uint64(len(m.tableName))) i-- dAtA[i] = 0xa } @@ -751,10 +751,10 @@ func (m *NodeError) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.TableName) > 0 { - i -= len(m.TableName) - copy(dAtA[i:], m.TableName) - i = encodeVarintStatus(dAtA, i, uint64(len(m.TableName))) + if len(m.tableName) > 0 { + i -= len(m.tableName) + copy(dAtA[i:], m.tableName) + i = encodeVarintStatus(dAtA, i, uint64(len(m.tableName))) i-- dAtA[i] = 0xa } @@ -883,7 +883,7 @@ func (m *NodeHealth) Size() (n int) { } var l int _ = l - l = len(m.TableName) + l = len(m.tableName) if l > 0 { n += 1 + l + sovStatus(uint64(l)) } @@ -913,7 +913,7 @@ func (m *NodeError) Size() (n int) { } var l int _ = l - l = len(m.TableName) + l = len(m.tableName) if l > 0 { n += 1 + l + sovStatus(uint64(l)) } @@ -1172,7 +1172,7 @@ func (m *NodeHealth) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field tableName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1200,7 +1200,7 @@ func (m *NodeHealth) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TableName = string(dAtA[iNdEx:postIndex]) + m.tableName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -1387,7 +1387,7 @@ func (m *NodeError) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TableName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field tableName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1415,7 +1415,7 @@ func (m *NodeError) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TableName = string(dAtA[iNdEx:postIndex]) + m.tableName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 {