Documentation ¶
Index ¶
- Variables
- type Header
- func (*Header) Descriptor() ([]byte, []int)deprecated
- func (x *Header) GetNodeId() string
- func (x *Header) GetNodePubKey() []byte
- func (x *Header) GetRequestId() string
- func (x *Header) GetSignature() []byte
- func (x *Header) GetTimestamp() int64
- func (*Header) ProtoMessage()
- func (x *Header) ProtoReflect() protoreflect.Message
- func (x *Header) Reset()
- func (x *Header) String() string
- type HeaderMessage
- type PushRequest
- func (*PushRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PushRequest) GetFileCount() bool
- func (x *PushRequest) GetHeader() *Header
- func (x *PushRequest) GetIsDir() bool
- func (x *PushRequest) GetName() string
- func (x *PushRequest) GetSize() int64
- func (x *PushRequest) PeerID() (peer.ID, error)
- func (*PushRequest) ProtoMessage()
- func (x *PushRequest) ProtoReflect() protoreflect.Message
- func (x *PushRequest) Reset()
- func (x *PushRequest) SetHeader(hdr *Header)
- func (x *PushRequest) String() string
- type PushResponse
- func (*PushResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PushResponse) GetAccept() bool
- func (x *PushResponse) GetHeader() *Header
- func (x *PushResponse) PeerID() (peer.ID, error)
- func (*PushResponse) ProtoMessage()
- func (x *PushResponse) ProtoReflect() protoreflect.Message
- func (x *PushResponse) Reset()
- func (x *PushResponse) SetHeader(hdr *Header)
- func (x *PushResponse) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var File_p2p_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct { // A unique request ID to allow idempotency. RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // Unix time in milliseconds. Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // The ID of the node that created the message (not the peer that may have sent it) NodeId string `protobuf:"bytes,3,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` // Authoring node Secp256k1 public key (32bytes) - protobufs serialized NodePubKey []byte `protobuf:"bytes,4,opt,name=node_pub_key,json=nodePubKey,proto3" json:"node_pub_key,omitempty"` // The signature of the message data. Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` // contains filtered or unexported fields }
A message object that is shared among all requests.
func (*Header) Descriptor
deprecated
func (*Header) GetNodePubKey ¶
func (*Header) GetRequestId ¶
func (*Header) GetSignature ¶
func (*Header) GetTimestamp ¶
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (*Header) ProtoReflect ¶
func (x *Header) ProtoReflect() protoreflect.Message
type HeaderMessage ¶
type PushRequest ¶
type PushRequest struct { // General meta information about the request. Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // The name of the file that is about to be transferred. // This will also be the name that the receiving peer // uses upon save. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // The size of the file to be transmitted. Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` // Whether or not the file is a directory. IsDir bool `protobuf:"varint,4,opt,name=is_dir,json=isDir,proto3" json:"is_dir,omitempty"` // The number of files to be transferred. FileCount bool `protobuf:"varint,5,opt,name=file_count,json=fileCount,proto3" json:"file_count,omitempty"` // contains filtered or unexported fields }
PushRequest is sent to the receiving peer for acceptance. It contains basic information about the data that is about to be transmitted.
func NewPushRequest ¶
func NewPushRequest(name string, size int64, isDir bool) *PushRequest
func (*PushRequest) Descriptor
deprecated
func (*PushRequest) Descriptor() ([]byte, []int)
Deprecated: Use PushRequest.ProtoReflect.Descriptor instead.
func (*PushRequest) GetFileCount ¶ added in v0.4.0
func (x *PushRequest) GetFileCount() bool
func (*PushRequest) GetHeader ¶
func (x *PushRequest) GetHeader() *Header
func (*PushRequest) GetIsDir ¶ added in v0.4.0
func (x *PushRequest) GetIsDir() bool
func (*PushRequest) GetName ¶ added in v0.4.0
func (x *PushRequest) GetName() string
func (*PushRequest) GetSize ¶
func (x *PushRequest) GetSize() int64
func (*PushRequest) ProtoMessage ¶
func (*PushRequest) ProtoMessage()
func (*PushRequest) ProtoReflect ¶
func (x *PushRequest) ProtoReflect() protoreflect.Message
func (*PushRequest) Reset ¶
func (x *PushRequest) Reset()
func (*PushRequest) SetHeader ¶
func (x *PushRequest) SetHeader(hdr *Header)
func (*PushRequest) String ¶
func (x *PushRequest) String() string
type PushResponse ¶
type PushResponse struct { // General meta information about the request. Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // Whether or not the user accepted the file transfer. Accept bool `protobuf:"varint,2,opt,name=accept,proto3" json:"accept,omitempty"` // contains filtered or unexported fields }
PushResponse is sent as a reply to the PushRequest message. It just indicates if the receiving peer is willing to accept the file.
func NewPushResponse ¶
func NewPushResponse(accept bool) *PushResponse
func (*PushResponse) Descriptor
deprecated
func (*PushResponse) Descriptor() ([]byte, []int)
Deprecated: Use PushResponse.ProtoReflect.Descriptor instead.
func (*PushResponse) GetAccept ¶
func (x *PushResponse) GetAccept() bool
func (*PushResponse) GetHeader ¶
func (x *PushResponse) GetHeader() *Header
func (*PushResponse) ProtoMessage ¶
func (*PushResponse) ProtoMessage()
func (*PushResponse) ProtoReflect ¶
func (x *PushResponse) ProtoReflect() protoreflect.Message
func (*PushResponse) Reset ¶
func (x *PushResponse) Reset()
func (*PushResponse) SetHeader ¶
func (x *PushResponse) SetHeader(hdr *Header)
func (*PushResponse) String ¶
func (x *PushResponse) String() string
Click to show internal directories.
Click to hide internal directories.