message

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0, MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadEncoding = errors.New("invalid message encoding")

Functions

This section is empty.

Types

type Message

type Message struct {
	// Cid identifies the advertisement being announced.
	Cid cid.Cid
	// Addrs contains a set of multiaddrs that specify where the announced
	// advertisement is available. See SetAddrs and GetAddrs.
	Addrs [][]byte
	// ExtraData is optional data indended for a certain recipients. For
	// example, a publisher may include its storage provider ID for validation
	// by a gateway.
	ExtraData []byte
	// The OrigPeer field may or may not be present in the serialized data, and
	// the CBOR serializer/deserializer is able to detect that. Only messages
	// that are re-published by an indexer, for consumption by othen indexers,
	// contain this field.
	OrigPeer string
}

Message announces the availability of an IPNI advertisement..

func (*Message) GetAddrs

func (m *Message) GetAddrs() ([]multiaddr.Multiaddr, error)

GetAddrs reads the slice of Multiaddr that is stored in the Message as a slice of []byte.

func (*Message) MarshalCBOR

func (m *Message) MarshalCBOR(w io.Writer) error

func (*Message) SetAddrs

func (m *Message) SetAddrs(addrs []multiaddr.Multiaddr)

SetAddrs writes a slice of Multiaddr into the Message as a slice of []byte.

func (*Message) UnmarshalCBOR

func (m *Message) UnmarshalCBOR(r io.Reader) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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