proto

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

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) Descriptor() ([]byte, []int)

Deprecated: Use Header.ProtoReflect.Descriptor instead.

func (*Header) GetNodeId

func (x *Header) GetNodeId() string

func (*Header) GetNodePubKey

func (x *Header) GetNodePubKey() []byte

func (*Header) GetRequestId

func (x *Header) GetRequestId() string

func (*Header) GetSignature

func (x *Header) GetSignature() []byte

func (*Header) GetTimestamp

func (x *Header) GetTimestamp() int64

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) ProtoReflect

func (x *Header) ProtoReflect() protoreflect.Message

func (*Header) Reset

func (x *Header) Reset()

func (*Header) String

func (x *Header) String() string

type HeaderMessage

type HeaderMessage interface {
	GetHeader() *Header
	SetHeader(*Header)
	PeerID() (peer.ID, error)
	proto.Message
}

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.
	Filename string `protobuf:"bytes,2,opt,name=filename,proto3" json:"filename,omitempty"`
	// The size of the file to be transmitted.
	Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,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(filename string, size int64) *PushRequest

func (*PushRequest) Descriptor deprecated

func (*PushRequest) Descriptor() ([]byte, []int)

Deprecated: Use PushRequest.ProtoReflect.Descriptor instead.

func (*PushRequest) GetFilename

func (x *PushRequest) GetFilename() string

func (*PushRequest) GetHeader

func (x *PushRequest) GetHeader() *Header

func (*PushRequest) GetSize

func (x *PushRequest) GetSize() int64

func (*PushRequest) PeerID

func (x *PushRequest) PeerID() (peer.ID, error)

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) PeerID

func (x *PushResponse) PeerID() (peer.ID, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL