github.com/uber/kraken@v0.1.4/gen/go/proto/p2p/p2p.pb.go (about)

     1  // Copyright (c) 2016-2019 Uber Technologies, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  // Code generated by protoc-gen-go.
    15  // source: proto/p2p/p2p.proto
    16  // DO NOT EDIT!
    17  
    18  /*
    19  Package p2p is a generated protocol buffer package.
    20  
    21  It is generated from these files:
    22  	proto/p2p/p2p.proto
    23  
    24  It has these top-level messages:
    25  	BitfieldMessage
    26  	PieceRequestMessage
    27  	PiecePayloadMessage
    28  	AnnouncePieceMessage
    29  	CancelPieceMessage
    30  	ErrorMessage
    31  	CompleteMessage
    32  	Message
    33  */
    34  package p2p
    35  
    36  import proto "github.com/golang/protobuf/proto"
    37  import fmt "fmt"
    38  import math "math"
    39  
    40  // Reference imports to suppress errors if they are not otherwise used.
    41  var _ = proto.Marshal
    42  var _ = fmt.Errorf
    43  var _ = math.Inf
    44  
    45  // This is a compile-time assertion to ensure that this generated file
    46  // is compatible with the proto package it is being compiled against.
    47  // A compilation error at this line likely means your copy of the
    48  // proto package needs to be updated.
    49  const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
    50  
    51  type ErrorMessage_ErrorCode int32
    52  
    53  const (
    54  	ErrorMessage_PIECE_REQUEST_FAILED ErrorMessage_ErrorCode = 0
    55  )
    56  
    57  var ErrorMessage_ErrorCode_name = map[int32]string{
    58  	0: "PIECE_REQUEST_FAILED",
    59  }
    60  var ErrorMessage_ErrorCode_value = map[string]int32{
    61  	"PIECE_REQUEST_FAILED": 0,
    62  }
    63  
    64  func (x ErrorMessage_ErrorCode) String() string {
    65  	return proto.EnumName(ErrorMessage_ErrorCode_name, int32(x))
    66  }
    67  func (ErrorMessage_ErrorCode) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 0} }
    68  
    69  type Message_Type int32
    70  
    71  const (
    72  	Message_BITFIELD      Message_Type = 0
    73  	Message_PIECE_REQUEST Message_Type = 1
    74  	Message_PIECE_PAYLOAD Message_Type = 2
    75  	Message_ANNOUCE_PIECE Message_Type = 3
    76  	Message_CANCEL_PIECE  Message_Type = 4
    77  	Message_ERROR         Message_Type = 5
    78  	Message_COMPLETE      Message_Type = 6
    79  )
    80  
    81  var Message_Type_name = map[int32]string{
    82  	0: "BITFIELD",
    83  	1: "PIECE_REQUEST",
    84  	2: "PIECE_PAYLOAD",
    85  	3: "ANNOUCE_PIECE",
    86  	4: "CANCEL_PIECE",
    87  	5: "ERROR",
    88  	6: "COMPLETE",
    89  }
    90  var Message_Type_value = map[string]int32{
    91  	"BITFIELD":      0,
    92  	"PIECE_REQUEST": 1,
    93  	"PIECE_PAYLOAD": 2,
    94  	"ANNOUCE_PIECE": 3,
    95  	"CANCEL_PIECE":  4,
    96  	"ERROR":         5,
    97  	"COMPLETE":      6,
    98  }
    99  
   100  func (x Message_Type) String() string {
   101  	return proto.EnumName(Message_Type_name, int32(x))
   102  }
   103  func (Message_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{7, 0} }
   104  
   105  // Binary set of all pieces that peer has downloaded so far. Also serves as a
   106  // handshaking message, which each peer sends once at the beginning of the
   107  // connection to declare what their peer id is and what info hash they want to
   108  // transmit.
   109  type BitfieldMessage struct {
   110  	InfoHash string `protobuf:"bytes,2,opt,name=infoHash" json:"infoHash,omitempty"`
   111  	// TODO: Torrent name is the content hash. Current torrent storage is
   112  	// content addressable. Adding name as a part of handshake makes looking
   113  	// up torrents faster. If storage supports addressing torrent by infohash,
   114  	// this extra field should removed.
   115  	// XXX(codyg): We rely on this name field for announcing too, so tracker can
   116  	// look up origins that have this content.
   117  	// We currently treat infohash as verification of torrents.
   118  	Name          string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"`
   119  	PeerID        string `protobuf:"bytes,4,opt,name=peerID" json:"peerID,omitempty"`
   120  	BitfieldBytes []byte `protobuf:"bytes,5,opt,name=bitfieldBytes,proto3" json:"bitfieldBytes,omitempty"`
   121  	Namespace     string `protobuf:"bytes,6,opt,name=namespace" json:"namespace,omitempty"`
   122  	// remoteBitfieldBytes contains the binary sets of pieces downloaded of
   123  	// all peers that the sender is currently connected to.
   124  	RemoteBitfieldBytes map[string][]byte `protobuf:"bytes,7,rep,name=remoteBitfieldBytes" json:"remoteBitfieldBytes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"`
   125  }
   126  
   127  func (m *BitfieldMessage) Reset()                    { *m = BitfieldMessage{} }
   128  func (m *BitfieldMessage) String() string            { return proto.CompactTextString(m) }
   129  func (*BitfieldMessage) ProtoMessage()               {}
   130  func (*BitfieldMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
   131  
   132  func (m *BitfieldMessage) GetRemoteBitfieldBytes() map[string][]byte {
   133  	if m != nil {
   134  		return m.RemoteBitfieldBytes
   135  	}
   136  	return nil
   137  }
   138  
   139  // Requests a piece of the given index. Note: offset and length are unused fields
   140  // and if set, will be rejected.
   141  type PieceRequestMessage struct {
   142  	Index  int32 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"`
   143  	Offset int32 `protobuf:"varint,3,opt,name=offset" json:"offset,omitempty"`
   144  	Length int32 `protobuf:"varint,4,opt,name=length" json:"length,omitempty"`
   145  }
   146  
   147  func (m *PieceRequestMessage) Reset()                    { *m = PieceRequestMessage{} }
   148  func (m *PieceRequestMessage) String() string            { return proto.CompactTextString(m) }
   149  func (*PieceRequestMessage) ProtoMessage()               {}
   150  func (*PieceRequestMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
   151  
   152  // Provides binary payload response to a peer request. Always immediately followed
   153  // by a binary blob sent over socket, so the receiver should be ready to treat the
   154  // blob as a non-protobuf message.
   155  type PiecePayloadMessage struct {
   156  	Index  int32  `protobuf:"varint,2,opt,name=index" json:"index,omitempty"`
   157  	Offset int32  `protobuf:"varint,3,opt,name=offset" json:"offset,omitempty"`
   158  	Length int32  `protobuf:"varint,4,opt,name=length" json:"length,omitempty"`
   159  	Digest string `protobuf:"bytes,5,opt,name=digest" json:"digest,omitempty"`
   160  }
   161  
   162  func (m *PiecePayloadMessage) Reset()                    { *m = PiecePayloadMessage{} }
   163  func (m *PiecePayloadMessage) String() string            { return proto.CompactTextString(m) }
   164  func (*PiecePayloadMessage) ProtoMessage()               {}
   165  func (*PiecePayloadMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
   166  
   167  // Announces that a piece is available to other peers.
   168  type AnnouncePieceMessage struct {
   169  	Index int32 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"`
   170  }
   171  
   172  func (m *AnnouncePieceMessage) Reset()                    { *m = AnnouncePieceMessage{} }
   173  func (m *AnnouncePieceMessage) String() string            { return proto.CompactTextString(m) }
   174  func (*AnnouncePieceMessage) ProtoMessage()               {}
   175  func (*AnnouncePieceMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
   176  
   177  // Unused.
   178  type CancelPieceMessage struct {
   179  	Index int32 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"`
   180  }
   181  
   182  func (m *CancelPieceMessage) Reset()                    { *m = CancelPieceMessage{} }
   183  func (m *CancelPieceMessage) String() string            { return proto.CompactTextString(m) }
   184  func (*CancelPieceMessage) ProtoMessage()               {}
   185  func (*CancelPieceMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
   186  
   187  // General purpose error message. Receivers may check the error code to determine
   188  // the origin of the message.
   189  type ErrorMessage struct {
   190  	Error string                 `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
   191  	Index int32                  `protobuf:"varint,3,opt,name=index" json:"index,omitempty"`
   192  	Code  ErrorMessage_ErrorCode `protobuf:"varint,4,opt,name=code,enum=p2p.ErrorMessage_ErrorCode" json:"code,omitempty"`
   193  }
   194  
   195  func (m *ErrorMessage) Reset()                    { *m = ErrorMessage{} }
   196  func (m *ErrorMessage) String() string            { return proto.CompactTextString(m) }
   197  func (*ErrorMessage) ProtoMessage()               {}
   198  func (*ErrorMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
   199  
   200  // Notifies other peers that the torrent has completed and all pieces are available.
   201  type CompleteMessage struct {
   202  }
   203  
   204  func (m *CompleteMessage) Reset()                    { *m = CompleteMessage{} }
   205  func (m *CompleteMessage) String() string            { return proto.CompactTextString(m) }
   206  func (*CompleteMessage) ProtoMessage()               {}
   207  func (*CompleteMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
   208  
   209  type Message struct {
   210  	Version       string                `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"`
   211  	Type          Message_Type          `protobuf:"varint,2,opt,name=type,enum=p2p.Message_Type" json:"type,omitempty"`
   212  	Bitfield      *BitfieldMessage      `protobuf:"bytes,3,opt,name=bitfield" json:"bitfield,omitempty"`
   213  	PieceRequest  *PieceRequestMessage  `protobuf:"bytes,4,opt,name=pieceRequest" json:"pieceRequest,omitempty"`
   214  	PiecePayload  *PiecePayloadMessage  `protobuf:"bytes,5,opt,name=piecePayload" json:"piecePayload,omitempty"`
   215  	AnnouncePiece *AnnouncePieceMessage `protobuf:"bytes,6,opt,name=announcePiece" json:"announcePiece,omitempty"`
   216  	CancelPiece   *CancelPieceMessage   `protobuf:"bytes,7,opt,name=cancelPiece" json:"cancelPiece,omitempty"`
   217  	Error         *ErrorMessage         `protobuf:"bytes,8,opt,name=error" json:"error,omitempty"`
   218  	Complete      *CompleteMessage      `protobuf:"bytes,9,opt,name=complete" json:"complete,omitempty"`
   219  }
   220  
   221  func (m *Message) Reset()                    { *m = Message{} }
   222  func (m *Message) String() string            { return proto.CompactTextString(m) }
   223  func (*Message) ProtoMessage()               {}
   224  func (*Message) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
   225  
   226  func (m *Message) GetBitfield() *BitfieldMessage {
   227  	if m != nil {
   228  		return m.Bitfield
   229  	}
   230  	return nil
   231  }
   232  
   233  func (m *Message) GetPieceRequest() *PieceRequestMessage {
   234  	if m != nil {
   235  		return m.PieceRequest
   236  	}
   237  	return nil
   238  }
   239  
   240  func (m *Message) GetPiecePayload() *PiecePayloadMessage {
   241  	if m != nil {
   242  		return m.PiecePayload
   243  	}
   244  	return nil
   245  }
   246  
   247  func (m *Message) GetAnnouncePiece() *AnnouncePieceMessage {
   248  	if m != nil {
   249  		return m.AnnouncePiece
   250  	}
   251  	return nil
   252  }
   253  
   254  func (m *Message) GetCancelPiece() *CancelPieceMessage {
   255  	if m != nil {
   256  		return m.CancelPiece
   257  	}
   258  	return nil
   259  }
   260  
   261  func (m *Message) GetError() *ErrorMessage {
   262  	if m != nil {
   263  		return m.Error
   264  	}
   265  	return nil
   266  }
   267  
   268  func (m *Message) GetComplete() *CompleteMessage {
   269  	if m != nil {
   270  		return m.Complete
   271  	}
   272  	return nil
   273  }
   274  
   275  func init() {
   276  	proto.RegisterType((*BitfieldMessage)(nil), "p2p.BitfieldMessage")
   277  	proto.RegisterType((*PieceRequestMessage)(nil), "p2p.PieceRequestMessage")
   278  	proto.RegisterType((*PiecePayloadMessage)(nil), "p2p.PiecePayloadMessage")
   279  	proto.RegisterType((*AnnouncePieceMessage)(nil), "p2p.AnnouncePieceMessage")
   280  	proto.RegisterType((*CancelPieceMessage)(nil), "p2p.CancelPieceMessage")
   281  	proto.RegisterType((*ErrorMessage)(nil), "p2p.ErrorMessage")
   282  	proto.RegisterType((*CompleteMessage)(nil), "p2p.CompleteMessage")
   283  	proto.RegisterType((*Message)(nil), "p2p.Message")
   284  	proto.RegisterEnum("p2p.ErrorMessage_ErrorCode", ErrorMessage_ErrorCode_name, ErrorMessage_ErrorCode_value)
   285  	proto.RegisterEnum("p2p.Message_Type", Message_Type_name, Message_Type_value)
   286  }
   287  
   288  func init() { proto.RegisterFile("proto/p2p/p2p.proto", fileDescriptor0) }
   289  
   290  var fileDescriptor0 = []byte{
   291  	// 647 bytes of a gzipped FileDescriptorProto
   292  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x54, 0x4f, 0x6f, 0xd3, 0x4e,
   293  	0x10, 0x6d, 0x12, 0x3b, 0x7f, 0x26, 0x69, 0xeb, 0x6c, 0xa3, 0xdf, 0xcf, 0x14, 0x0e, 0x95, 0x45,
   294  	0x45, 0x85, 0xa0, 0xad, 0xcc, 0x05, 0x10, 0x12, 0x4a, 0x1c, 0x57, 0x44, 0x4a, 0x9b, 0xb0, 0xa4,
   295  	0x07, 0xc4, 0xa1, 0x72, 0x9d, 0x49, 0x6b, 0x91, 0x7a, 0x8d, 0xed, 0x56, 0xcd, 0xd7, 0xe0, 0x43,
   296  	0x21, 0xf1, 0xad, 0xd0, 0x4e, 0xec, 0xc4, 0x6e, 0x02, 0xe2, 0xc0, 0x21, 0x92, 0xdf, 0xf3, 0x7b,
   297  	0xb3, 0xb3, 0x33, 0x2f, 0x86, 0x9d, 0x20, 0x14, 0xb1, 0x38, 0x0a, 0xcc, 0x40, 0xfe, 0x0e, 0x09,
   298  	0xb1, 0x52, 0x60, 0x06, 0xc6, 0x8f, 0x22, 0x6c, 0x77, 0xbc, 0x78, 0xe2, 0xe1, 0x74, 0x7c, 0x8a,
   299  	0x51, 0xe4, 0x5c, 0x21, 0xdb, 0x85, 0xaa, 0xe7, 0x4f, 0xc4, 0x07, 0x27, 0xba, 0xd6, 0x8b, 0x7b,
   300  	0x85, 0x83, 0x1a, 0x5f, 0x60, 0xc6, 0x40, 0xf1, 0x9d, 0x1b, 0xd4, 0x4b, 0xc4, 0xd3, 0x33, 0xfb,
   301  	0x0f, 0xca, 0x01, 0x62, 0xd8, 0xeb, 0xea, 0x0a, 0xb1, 0x09, 0x62, 0x4f, 0x61, 0xf3, 0x32, 0x29,
   302  	0xdd, 0x99, 0xc5, 0x18, 0xe9, 0xea, 0x5e, 0xe1, 0xa0, 0xc1, 0xf3, 0x24, 0x7b, 0x02, 0x35, 0x59,
   303  	0x25, 0x0a, 0x1c, 0x17, 0xf5, 0x32, 0x15, 0x58, 0x12, 0xec, 0x02, 0x76, 0x42, 0xbc, 0x11, 0x31,
   304  	0x76, 0x72, 0x95, 0x2a, 0x7b, 0xa5, 0x83, 0xba, 0xf9, 0xf2, 0x50, 0xde, 0xe6, 0x41, 0xfb, 0x87,
   305  	0x7c, 0x55, 0x6f, 0xfb, 0x71, 0x38, 0xe3, 0xeb, 0x2a, 0xed, 0x9e, 0x80, 0xfe, 0x3b, 0x03, 0xd3,
   306  	0xa0, 0xf4, 0x15, 0x67, 0x7a, 0x81, 0x9a, 0x92, 0x8f, 0xac, 0x05, 0xea, 0x9d, 0x33, 0xbd, 0x45,
   307  	0x9a, 0x4b, 0x83, 0xcf, 0xc1, 0xdb, 0xe2, 0xeb, 0x82, 0xf1, 0x05, 0x76, 0x86, 0x1e, 0xba, 0xc8,
   308  	0xf1, 0xdb, 0x2d, 0x46, 0x71, 0x3a, 0xcb, 0x16, 0xa8, 0x9e, 0x3f, 0xc6, 0x7b, 0x32, 0xa8, 0x7c,
   309  	0x0e, 0xe4, 0xc4, 0xc4, 0x64, 0x12, 0x61, 0x4c, 0x73, 0x54, 0x79, 0x82, 0x24, 0x3f, 0x45, 0xff,
   310  	0x2a, 0xbe, 0xa6, 0x49, 0xaa, 0x3c, 0x41, 0x46, 0x94, 0x14, 0x1f, 0x3a, 0xb3, 0xa9, 0x70, 0xc6,
   311  	0xff, 0xb4, 0xb8, 0xe4, 0xc7, 0xde, 0x15, 0x46, 0x31, 0xed, 0xa7, 0xc6, 0x13, 0x64, 0xbc, 0x80,
   312  	0x56, 0xdb, 0xf7, 0xc5, 0xad, 0xef, 0x22, 0x1d, 0xfe, 0xc7, 0x53, 0x8d, 0xe7, 0xc0, 0x2c, 0xc7,
   313  	0x77, 0x71, 0xfa, 0x17, 0xda, 0xef, 0x05, 0x68, 0xd8, 0x61, 0x28, 0xc2, 0x8c, 0x0c, 0x25, 0x4e,
   314  	0xe2, 0x36, 0x07, 0x4b, 0x73, 0x29, 0x7b, 0xbd, 0x23, 0x50, 0x5c, 0x31, 0x46, 0xba, 0xc4, 0x96,
   315  	0xf9, 0x98, 0x22, 0x90, 0x2d, 0x36, 0x07, 0x96, 0x18, 0x23, 0x27, 0xa1, 0xb1, 0x0f, 0xb5, 0x05,
   316  	0xc5, 0x74, 0x68, 0x0d, 0x7b, 0xb6, 0x65, 0x5f, 0x70, 0xfb, 0xe3, 0xb9, 0xfd, 0x69, 0x74, 0x71,
   317  	0xd2, 0xee, 0xf5, 0xed, 0xae, 0xb6, 0x61, 0x34, 0x61, 0xdb, 0x12, 0x37, 0xc1, 0x14, 0xe3, 0xb4,
   318  	0x7b, 0xe3, 0xa7, 0x02, 0x95, 0xb4, 0x45, 0x1d, 0x2a, 0x77, 0x18, 0x46, 0x9e, 0xf0, 0x93, 0x3c,
   319  	0xa4, 0x90, 0xed, 0x83, 0x12, 0xcf, 0x82, 0x79, 0x24, 0xb6, 0xcc, 0x26, 0x35, 0x94, 0xf6, 0x32,
   320  	0x9a, 0x05, 0xc8, 0xe9, 0x35, 0x3b, 0x86, 0x6a, 0x1a, 0x7c, 0xba, 0x50, 0xdd, 0x6c, 0xad, 0x8b,
   321  	0x2f, 0x5f, 0xa8, 0xd8, 0x3b, 0x68, 0x04, 0x99, 0x48, 0xd1, 0x8d, 0xeb, 0xa6, 0x4e, 0xae, 0x35,
   322  	0x59, 0xe3, 0x39, 0xf5, 0xc2, 0x9d, 0x64, 0x86, 0x96, 0x9b, 0x73, 0xe7, 0xc3, 0xc4, 0x73, 0x6a,
   323  	0xf6, 0x1e, 0x36, 0x9d, 0xec, 0xf2, 0xe9, 0x9f, 0x59, 0x37, 0x1f, 0x91, 0x7d, 0x5d, 0x2c, 0x78,
   324  	0x5e, 0xcf, 0xde, 0x40, 0xdd, 0x5d, 0xe6, 0x41, 0xaf, 0x90, 0xfd, 0x7f, 0xb2, 0xaf, 0xe6, 0x84,
   325  	0x67, 0xb5, 0xec, 0x59, 0x9a, 0x86, 0x2a, 0x99, 0x9a, 0x2b, 0x2b, 0x4e, 0x03, 0x72, 0x0c, 0x55,
   326  	0x37, 0x59, 0x99, 0x5e, 0xcb, 0x8c, 0xf4, 0xc1, 0x1e, 0xf9, 0x42, 0x65, 0xdc, 0x83, 0x22, 0x57,
   327  	0xc2, 0x1a, 0x50, 0xed, 0xf4, 0x46, 0x27, 0x3d, 0xbb, 0xdf, 0xd5, 0x36, 0x58, 0x13, 0x36, 0x73,
   328  	0xa1, 0xd0, 0x0a, 0x4b, 0x6a, 0xd8, 0xfe, 0xdc, 0x1f, 0xb4, 0xbb, 0x5a, 0x51, 0x52, 0xed, 0xb3,
   329  	0xb3, 0xc1, 0xb9, 0x24, 0xe5, 0x2b, 0xad, 0xc4, 0x34, 0x68, 0x58, 0xed, 0x33, 0xcb, 0xee, 0x27,
   330  	0x8c, 0xc2, 0x6a, 0xa0, 0xda, 0x9c, 0x0f, 0xb8, 0xa6, 0xca, 0x33, 0xac, 0xc1, 0xe9, 0xb0, 0x6f,
   331  	0x8f, 0x6c, 0xad, 0x7c, 0x59, 0xa6, 0x8f, 0xee, 0xab, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xfd,
   332  	0x11, 0xd8, 0xe6, 0x8b, 0x05, 0x00, 0x00,
   333  }