storj/pkg/pb/bandwidth.pb.go

345 lines
13 KiB
Go
Raw Normal View History

// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: bandwidth.proto
package pb
import (
context "context"
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
grpc "google.golang.org/grpc"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type AgreementsSummary_Status int32
const (
AgreementsSummary_FAIL AgreementsSummary_Status = 0
AgreementsSummary_OK AgreementsSummary_Status = 1
AgreementsSummary_REJECTED AgreementsSummary_Status = 2
)
var AgreementsSummary_Status_name = map[int32]string{
0: "FAIL",
1: "OK",
2: "REJECTED",
}
var AgreementsSummary_Status_value = map[string]int32{
"FAIL": 0,
"OK": 1,
"REJECTED": 2,
}
func (x AgreementsSummary_Status) String() string {
return proto.EnumName(AgreementsSummary_Status_name, int32(x))
}
func (AgreementsSummary_Status) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_ed768d1bfad2d961, []int{0, 0}
}
type AgreementsSummary struct {
Status AgreementsSummary_Status `protobuf:"varint,1,opt,name=status,proto3,enum=bandwidth.AgreementsSummary_Status" json:"status,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *AgreementsSummary) Reset() { *m = AgreementsSummary{} }
func (m *AgreementsSummary) String() string { return proto.CompactTextString(m) }
func (*AgreementsSummary) ProtoMessage() {}
func (*AgreementsSummary) Descriptor() ([]byte, []int) {
return fileDescriptor_ed768d1bfad2d961, []int{0}
}
func (m *AgreementsSummary) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AgreementsSummary.Unmarshal(m, b)
}
func (m *AgreementsSummary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_AgreementsSummary.Marshal(b, m, deterministic)
}
func (m *AgreementsSummary) XXX_Merge(src proto.Message) {
xxx_messageInfo_AgreementsSummary.Merge(m, src)
}
func (m *AgreementsSummary) XXX_Size() int {
return xxx_messageInfo_AgreementsSummary.Size(m)
}
func (m *AgreementsSummary) XXX_DiscardUnknown() {
xxx_messageInfo_AgreementsSummary.DiscardUnknown(m)
}
var xxx_messageInfo_AgreementsSummary proto.InternalMessageInfo
func (m *AgreementsSummary) GetStatus() AgreementsSummary_Status {
if m != nil {
return m.Status
}
return AgreementsSummary_FAIL
}
2019-03-19 12:56:59 +00:00
type BandwidthSettlementRequest struct {
Allocation *RenterBandwidthAllocation `protobuf:"bytes,1,opt,name=allocation,proto3" json:"allocation,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BandwidthSettlementRequest) Reset() { *m = BandwidthSettlementRequest{} }
func (m *BandwidthSettlementRequest) String() string { return proto.CompactTextString(m) }
func (*BandwidthSettlementRequest) ProtoMessage() {}
func (*BandwidthSettlementRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_ed768d1bfad2d961, []int{1}
}
func (m *BandwidthSettlementRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BandwidthSettlementRequest.Unmarshal(m, b)
}
func (m *BandwidthSettlementRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BandwidthSettlementRequest.Marshal(b, m, deterministic)
}
func (m *BandwidthSettlementRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_BandwidthSettlementRequest.Merge(m, src)
}
func (m *BandwidthSettlementRequest) XXX_Size() int {
return xxx_messageInfo_BandwidthSettlementRequest.Size(m)
}
func (m *BandwidthSettlementRequest) XXX_DiscardUnknown() {
xxx_messageInfo_BandwidthSettlementRequest.DiscardUnknown(m)
}
var xxx_messageInfo_BandwidthSettlementRequest proto.InternalMessageInfo
func (m *BandwidthSettlementRequest) GetAllocation() *RenterBandwidthAllocation {
if m != nil {
return m.Allocation
}
return nil
}
type BandwidthSettlementResponse struct {
SerialNumber string `protobuf:"bytes,1,opt,name=serial_number,json=serialNumber,proto3" json:"serial_number,omitempty"`
Status AgreementsSummary_Status `protobuf:"varint,2,opt,name=status,proto3,enum=bandwidth.AgreementsSummary_Status" json:"status,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BandwidthSettlementResponse) Reset() { *m = BandwidthSettlementResponse{} }
func (m *BandwidthSettlementResponse) String() string { return proto.CompactTextString(m) }
func (*BandwidthSettlementResponse) ProtoMessage() {}
func (*BandwidthSettlementResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_ed768d1bfad2d961, []int{2}
}
func (m *BandwidthSettlementResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BandwidthSettlementResponse.Unmarshal(m, b)
}
func (m *BandwidthSettlementResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BandwidthSettlementResponse.Marshal(b, m, deterministic)
}
func (m *BandwidthSettlementResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_BandwidthSettlementResponse.Merge(m, src)
}
func (m *BandwidthSettlementResponse) XXX_Size() int {
return xxx_messageInfo_BandwidthSettlementResponse.Size(m)
}
func (m *BandwidthSettlementResponse) XXX_DiscardUnknown() {
xxx_messageInfo_BandwidthSettlementResponse.DiscardUnknown(m)
}
var xxx_messageInfo_BandwidthSettlementResponse proto.InternalMessageInfo
func (m *BandwidthSettlementResponse) GetSerialNumber() string {
if m != nil {
return m.SerialNumber
}
return ""
}
func (m *BandwidthSettlementResponse) GetStatus() AgreementsSummary_Status {
if m != nil {
return m.Status
}
return AgreementsSummary_FAIL
}
func init() {
proto.RegisterEnum("bandwidth.AgreementsSummary_Status", AgreementsSummary_Status_name, AgreementsSummary_Status_value)
proto.RegisterType((*AgreementsSummary)(nil), "bandwidth.AgreementsSummary")
2019-03-19 12:56:59 +00:00
proto.RegisterType((*BandwidthSettlementRequest)(nil), "bandwidth.BandwidthSettlementRequest")
proto.RegisterType((*BandwidthSettlementResponse)(nil), "bandwidth.BandwidthSettlementResponse")
}
func init() { proto.RegisterFile("bandwidth.proto", fileDescriptor_ed768d1bfad2d961) }
var fileDescriptor_ed768d1bfad2d961 = []byte{
2019-03-19 12:56:59 +00:00
// 311 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x4f, 0x4b, 0xfb, 0x40,
0x14, 0x6c, 0x42, 0x09, 0xed, 0xfb, 0xf5, 0xa7, 0x71, 0xbd, 0x48, 0xf4, 0x20, 0x5b, 0x94, 0x82,
0x10, 0xa4, 0x1e, 0x3d, 0xb5, 0x5a, 0x41, 0x2b, 0x0a, 0x5b, 0x4f, 0x5e, 0x64, 0xd3, 0x3e, 0x34,
0x90, 0xec, 0xc6, 0xdd, 0x17, 0x44, 0x2f, 0x7e, 0x47, 0x3f, 0x91, 0xb0, 0xd1, 0xa4, 0xe0, 0x3f,
0x7a, 0x9d, 0x9d, 0x99, 0x37, 0x33, 0x2c, 0xac, 0x27, 0x52, 0x2d, 0x9e, 0xd2, 0x05, 0x3d, 0xc4,
0x85, 0xd1, 0xa4, 0x59, 0xb7, 0x06, 0xa2, 0xb0, 0x48, 0x71, 0x8e, 0x96, 0xb4, 0xc1, 0xea, 0x91,
0xbf, 0xc0, 0xc6, 0xe8, 0xde, 0x20, 0xe6, 0xa8, 0xc8, 0xce, 0xca, 0x3c, 0x97, 0xe6, 0x99, 0x1d,
0x43, 0x60, 0x49, 0x52, 0x69, 0xb7, 0xbc, 0x5d, 0x6f, 0xb0, 0x36, 0xec, 0xc7, 0x8d, 0xe7, 0x17,
0x76, 0x3c, 0x73, 0x54, 0xf1, 0x21, 0xe1, 0x03, 0x08, 0x2a, 0x84, 0x75, 0xa0, 0x7d, 0x36, 0x3a,
0xbf, 0x0c, 0x5b, 0x2c, 0x00, 0xff, 0x7a, 0x1a, 0x7a, 0xac, 0x07, 0x1d, 0x31, 0xb9, 0x98, 0x9c,
0xdc, 0x4c, 0x4e, 0x43, 0x9f, 0xa7, 0x10, 0x8d, 0x3f, 0x7d, 0x67, 0x48, 0x94, 0x39, 0x5f, 0x81,
0x8f, 0x25, 0x5a, 0x62, 0x53, 0x00, 0x99, 0x65, 0x7a, 0x2e, 0x29, 0xd5, 0xca, 0x05, 0xf9, 0x37,
0x3c, 0x88, 0x9b, 0x02, 0x46, 0x97, 0x84, 0x36, 0x16, 0xa8, 0x08, 0x4d, 0xed, 0x33, 0xaa, 0x25,
0x62, 0x49, 0xce, 0x5f, 0x61, 0xfb, 0xdb, 0x53, 0xb6, 0xd0, 0xca, 0x22, 0xeb, 0xc3, 0x7f, 0x8b,
0x26, 0x95, 0xd9, 0x9d, 0x2a, 0xf3, 0x04, 0x8d, 0x3b, 0xd7, 0x15, 0xbd, 0x0a, 0xbc, 0x72, 0xd8,
0xd2, 0x2a, 0xfe, 0xca, 0xab, 0x0c, 0xdf, 0x3c, 0xe8, 0xd6, 0x09, 0x58, 0x02, 0x9b, 0x4d, 0xe2,
0x5a, 0xca, 0x56, 0xa9, 0x17, 0xed, 0xfc, 0x76, 0x9e, 0xb7, 0x98, 0x04, 0x68, 0x9a, 0xb2, 0xbd,
0x25, 0xf6, 0xcf, 0xa3, 0x47, 0xfb, 0x7f, 0xd1, 0xaa, 0xc1, 0x78, 0x6b, 0xe0, 0x1d, 0x7a, 0xe3,
0xf6, 0xad, 0x5f, 0x24, 0x49, 0xe0, 0x7e, 0xd2, 0xd1, 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x43,
0x1b, 0x7d, 0x0f, 0x79, 0x02, 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
// BandwidthClient is the client API for Bandwidth service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type BandwidthClient interface {
BandwidthAgreements(ctx context.Context, in *RenterBandwidthAllocation, opts ...grpc.CallOption) (*AgreementsSummary, error)
2019-03-19 12:56:59 +00:00
Settlement(ctx context.Context, opts ...grpc.CallOption) (Bandwidth_SettlementClient, error)
}
type bandwidthClient struct {
cc *grpc.ClientConn
}
func NewBandwidthClient(cc *grpc.ClientConn) BandwidthClient {
return &bandwidthClient{cc}
}
func (c *bandwidthClient) BandwidthAgreements(ctx context.Context, in *RenterBandwidthAllocation, opts ...grpc.CallOption) (*AgreementsSummary, error) {
out := new(AgreementsSummary)
err := c.cc.Invoke(ctx, "/bandwidth.Bandwidth/BandwidthAgreements", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
2019-03-19 12:56:59 +00:00
func (c *bandwidthClient) Settlement(ctx context.Context, opts ...grpc.CallOption) (Bandwidth_SettlementClient, error) {
stream, err := c.cc.NewStream(ctx, &_Bandwidth_serviceDesc.Streams[0], "/bandwidth.Bandwidth/Settlement", opts...)
if err != nil {
return nil, err
}
x := &bandwidthSettlementClient{stream}
return x, nil
}
type Bandwidth_SettlementClient interface {
Send(*BandwidthSettlementRequest) error
Recv() (*BandwidthSettlementResponse, error)
grpc.ClientStream
}
type bandwidthSettlementClient struct {
grpc.ClientStream
}
func (x *bandwidthSettlementClient) Send(m *BandwidthSettlementRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *bandwidthSettlementClient) Recv() (*BandwidthSettlementResponse, error) {
m := new(BandwidthSettlementResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// BandwidthServer is the server API for Bandwidth service.
type BandwidthServer interface {
BandwidthAgreements(context.Context, *RenterBandwidthAllocation) (*AgreementsSummary, error)
2019-03-19 12:56:59 +00:00
Settlement(Bandwidth_SettlementServer) error
}
func RegisterBandwidthServer(s *grpc.Server, srv BandwidthServer) {
s.RegisterService(&_Bandwidth_serviceDesc, srv)
}
func _Bandwidth_BandwidthAgreements_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RenterBandwidthAllocation)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BandwidthServer).BandwidthAgreements(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/bandwidth.Bandwidth/BandwidthAgreements",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BandwidthServer).BandwidthAgreements(ctx, req.(*RenterBandwidthAllocation))
}
return interceptor(ctx, in, info, handler)
}
2019-03-19 12:56:59 +00:00
func _Bandwidth_Settlement_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(BandwidthServer).Settlement(&bandwidthSettlementServer{stream})
}
type Bandwidth_SettlementServer interface {
Send(*BandwidthSettlementResponse) error
Recv() (*BandwidthSettlementRequest, error)
grpc.ServerStream
}
type bandwidthSettlementServer struct {
grpc.ServerStream
}
func (x *bandwidthSettlementServer) Send(m *BandwidthSettlementResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *bandwidthSettlementServer) Recv() (*BandwidthSettlementRequest, error) {
m := new(BandwidthSettlementRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
var _Bandwidth_serviceDesc = grpc.ServiceDesc{
ServiceName: "bandwidth.Bandwidth",
HandlerType: (*BandwidthServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "BandwidthAgreements",
Handler: _Bandwidth_BandwidthAgreements_Handler,
},
},
2019-03-19 12:56:59 +00:00
Streams: []grpc.StreamDesc{
{
StreamName: "Settlement",
Handler: _Bandwidth_Settlement_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "bandwidth.proto",
}