model

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0, MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const IngestRequestEnvelopeDomain = "indexer-ingest-request-record"

IngestRequestEnvelopeDomain is the domain string used for ingest requests contained in a Envelope.

Variables

View Source
var IngestRequestEnvelopePayloadType = []byte("indexer-ingest-request")

IngestRequestEnvelopePayloadType is the type hint used to identify IngestRequest records in a Envelope.

Functions

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 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.

Jump to

Keyboard shortcuts

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