Documentation ¶
Index ¶
- Variables
- type Location
- func (loc Location) Codec() []byte
- func (loc Location) Domain() string
- func (loc Location) Maddrs() ([]ma.Multiaddr, error)
- func (loc Location) MarshalRecord() ([]byte, error)
- func (loc Location) SetAnchor(anchor string) error
- func (loc Location) SetCustom(custom capnp.Ptr) error
- func (loc Location) SetMaddrs(maddrs []ma.Multiaddr) error
- func (loc *Location) UnmarshalRecord(b []byte) error
- func (loc Location) Validate(topic string) error
- type Registry
- type RegistryServer
- type Server
Constants ¶
This section is empty.
Variables ¶
var ( EnvelopeDomain = "ww/registry/location" EnvelopePayloadType = []byte{0x1f, 0x01} )
var ErrInvalidSignature = errors.New("invalid signature")
Functions ¶
This section is empty.
Types ¶
type Location ¶
func NewLocation ¶
func (Location) Codec ¶
Codec is a binary identifier for this type of record, ideally a registered multicodec (see https://github.com/multiformats/multicodec). When a Record is put into an Envelope (see record.Seal), the Codec value will be used as the Envelope's PayloadType. When the Envelope is later unsealed, the PayloadType will be used to lookup the correct Record type to unmarshal the Envelope payload into.
func (Location) Domain ¶
Domain is the "signature domain" used when signing and verifying a particular Record type. The Domain string should be unique to your Record type, and all instances of the Record type must have the same Domain string.
func (Location) MarshalRecord ¶
MarshalRecord converts a Record instance to a []byte, so that it can be used as an Envelope payload.
func (*Location) UnmarshalRecord ¶
UnmarshalRecord unmarshals a []byte payload into an instance of a particular Record type.
type RegistryServer ¶
type RegistryServer struct{}
func (*RegistryServer) Client ¶
func (s *RegistryServer) Client() capnp.Client
func (*RegistryServer) FindProviders ¶
func (s *RegistryServer) FindProviders(ctx context.Context, call api.Registry_findProviders) error
func (*RegistryServer) Provide ¶
func (s *RegistryServer) Provide(ctx context.Context, call api.Registry_provide) error