Documentation ¶
Index ¶
- Constants
- Variables
- func MakeDiscoverRequest(providerID peer.ID, privateKey crypto.PrivKey, discoveryAddr string) ([]byte, error)
- func MakeIngestRequest(providerID peer.ID, privateKey crypto.PrivKey, m multihash.Multihash, ...) ([]byte, error)
- func MakeRegisterRequest(providerID peer.ID, privateKey crypto.PrivKey, addrs []string) ([]byte, error)
- func ReadRegisterRequest(data []byte) (*peer.PeerRecord, error)
- type DiscoverRequest
- type IngestRequest
Constants ¶
const DiscoverRequestEnvelopeDomain = "indexer-discover-request-record"
DiscoverRequestEnvelopeDomain is the domain string used for discover requests contained in a Envelope
const IngestRequestEnvelopeDomain = "indexer-ingest-request-record"
IngestRequestEnvelopeDomain is the domain string used for ingest requests contained in a Envelope.
Variables ¶
var DiscoverRequestEnvelopePayloadType = []byte("indexer-discover-request")
DiscoverRequestEnvelopePayloadType is the type hint used to identify DiscoverRequest records in a Envelope.
var IngestRequestEnvelopePayloadType = []byte("indexer-ingest-request")
IngestRequestEnvelopePayloadType is the type hint used to identify IngestRequest records in a Envelope.
Functions ¶
func MakeDiscoverRequest ¶
func MakeDiscoverRequest(providerID peer.ID, privateKey crypto.PrivKey, discoveryAddr string) ([]byte, error)
MakeDiscoverRequest creates a signed DiscoverRequest and marshals it into bytes
func MakeIngestRequest ¶
func MakeIngestRequest(providerID peer.ID, privateKey crypto.PrivKey, m multihash.Multihash, contextID []byte, metadata []byte, addrs []string) ([]byte, error)
MakeIngestRequest creates a signed IngestRequest and marshals it into bytes
func MakeRegisterRequest ¶
func MakeRegisterRequest(providerID peer.ID, privateKey crypto.PrivKey, addrs []string) ([]byte, error)
MakeRegisterRequest creates a signed peer.PeerRecord as a register request and marshals this into bytes
func ReadRegisterRequest ¶
func ReadRegisterRequest(data []byte) (*peer.PeerRecord, error)
ReadRegisterRequest unmarshals a peer.PeerRequest from bytes, verifies the signature, and returns a peer.PeerRecord
Types ¶
type DiscoverRequest ¶
func ReadDiscoverRequest ¶
func ReadDiscoverRequest(data []byte) (*DiscoverRequest, error)
ReadDiscoverRequest unmarshals a DiscoverRequest from bytes, verifies the signature, and returns the DiscoverRequest
func (*DiscoverRequest) Codec ¶
func (r *DiscoverRequest) Codec() []byte
Codec is a binary identifier for the DiscoverRequest type
func (*DiscoverRequest) Domain ¶
func (r *DiscoverRequest) Domain() string
Domain is used when signing and validating DiscoverRequest records contained in Envelopes
func (*DiscoverRequest) MarshalRecord ¶
func (r *DiscoverRequest) MarshalRecord() ([]byte, error)
MarshalRecord serializes an DiscoverRequesr to a byte slice.
func (*DiscoverRequest) UnmarshalRecord ¶
func (r *DiscoverRequest) UnmarshalRecord(data []byte) error
UnmarshalRecord parses a DiscoverRequest from a byte slice
type IngestRequest ¶
type IngestRequest struct { Multihash multihash.Multihash ProviderID peer.ID ContextID []byte Metadata []byte Addrs []string Seq uint64 }
IgenstRequest is a request to store a single multihash. This is intentionally limited to one multihash as bulk ingestion should be done via advertisement ingestion method.
func ReadIngestRequest ¶
func ReadIngestRequest(data []byte) (*IngestRequest, error)
ReadIngestRequest unmarshals an IngestRequest from bytes, verifies the signature, and returns the IngestRequest
func (*IngestRequest) Codec ¶
func (r *IngestRequest) Codec() []byte
Codec is a binary identifier for the IngestRequest type
func (*IngestRequest) Domain ¶
func (r *IngestRequest) Domain() string
Domain is used when signing and validating IngestRequest records contained in Envelopes
func (*IngestRequest) MarshalRecord ¶
func (r *IngestRequest) MarshalRecord() ([]byte, error)
MarshalRecord serializes an IngestRequesr to a byte slice.
func (*IngestRequest) UnmarshalRecord ¶
func (r *IngestRequest) UnmarshalRecord(data []byte) error
UnmarshalRecord parses an IngestRequest from a byte slice.