Documentation ¶
Index ¶
- Constants
- func TopicForPeerID(id peer.ID) string
- type Payload
- type Record
- type System
- func (s *System) GetValue(ctx context.Context, id peer.ID) (*Record, error)
- func (s *System) Publish(ctx context.Context, key crypto.PrivKey, id cid.Cid) error
- func (s *System) PutValue(ctx context.Context, id peer.ID, rec *Record) error
- func (s *System) Resolve(ctx context.Context, id peer.ID) (cid.Cid, error)
- func (s *System) Search(ctx context.Context, id peer.ID) (cid.Cid, error)
- func (s *System) SearchValue(ctx context.Context, id peer.ID) (*Record, error)
- func (s *System) Subscribe(id peer.ID) error
- func (s *System) Unsubscribe(id peer.ID) (bool, error)
- type Validator
Constants ¶
View Source
const Namespace = "multiverse"
Namespace is the pubsub topic namespace.
Variables ¶
This section is empty.
Functions ¶
func TopicForPeerID ¶
TopicForPeerID returns the topic name for the given peer id.
Types ¶
type Payload ¶
type Payload struct { // Value contains the payload data. Value []byte // Sequence is a version and nonce. Sequence uint64 }
Payload contains record data.
type Record ¶
Record is used for record signatures.
func RecordFromCBOR ¶
RecordFromCBOR decodes an envelope from cbor.
type System ¶
type System struct {
// contains filtered or unexported fields
}
System performs name resolution.
func NewSystem ¶
func NewSystem(ctx context.Context, host host.Host, router routing.Routing, dstore datastore.Datastore) (*System, error)
NewNameSystem returns a new name system.
func (*System) Publish ¶
Publish advertises the given id to the topic of the peer ID from the private key.
func (*System) Search ¶
Search searches for the the latest value from the topic with the given peer ID.
func (*System) SearchValue ¶
Search searches for the the latest value from the topic with the given peer ID.
Click to show internal directories.
Click to hide internal directories.