Documentation ¶
Index ¶
- Constants
- Variables
- type Announcement
- type AnnouncementType
- type Blox
- func (p *Blox) Has(ctx context.Context, l ipld.Link) (bool, error)
- func (p *Blox) Load(ctx context.Context, l ipld.Link, np ipld.NodePrototype) (ipld.Node, error)
- func (p *Blox) Pull(ctx context.Context, from peer.ID, l ipld.Link) error
- func (p *Blox) Push(ctx context.Context, from peer.ID, l ipld.Link) error
- func (p *Blox) SetAuth(ctx context.Context, on peer.ID, subject peer.ID, allow bool) error
- func (p *Blox) Shutdown(ctx context.Context) error
- func (p *Blox) Start(ctx context.Context) error
- func (p *Blox) Store(ctx context.Context, n ipld.Node) (ipld.Link, error)
- type Option
- func WithAnnounceInterval(i time.Duration) Option
- func WithDatastore(ds datastore.Batching) Option
- func WithExchangeOpts(eo ...exchange.Option) Option
- func WithHost(h host.Host) Option
- func WithLinkSystem(ls *ipld.LinkSystem) Option
- func WithPoolName(n string) Option
- func WithTopicName(n string) Option
Constants ¶
View Source
const Version0 = "0"
Variables ¶
View Source
var ( PubSubPrototypes struct { Announcement schema.TypedPrototype } )
Functions ¶
This section is empty.
Types ¶
type Announcement ¶
type Announcement struct { Version string Type AnnouncementType Addrs []string }
func (*Announcement) GetAddrs ¶
func (a *Announcement) GetAddrs() ([]multiaddr.Multiaddr, error)
func (*Announcement) MarshalBinary ¶
func (a *Announcement) MarshalBinary() ([]byte, error)
func (*Announcement) SetAddrs ¶
func (a *Announcement) SetAddrs(ma ...multiaddr.Multiaddr)
func (*Announcement) UnmarshalBinary ¶
func (a *Announcement) UnmarshalBinary(b []byte) error
type AnnouncementType ¶
type AnnouncementType int
const ( UnknownAnnouncementType AnnouncementType = iota IExistAnnouncementType )
type Blox ¶
type Blox struct {
// contains filtered or unexported fields
}
type Option ¶
type Option func(*options) error
func WithAnnounceInterval ¶
WithAnnounceInterval sets the interval at which announcements are made on the pubsub. Defaults to 5 seconds if unset.
func WithDatastore ¶
func WithDatastore(ds datastore.Batching) Option
func WithExchangeOpts ¶ added in v1.0.0
func WithHost ¶
WithHost sets the libp2p host on which the blox is exposed. If unset a default host with random identity is used. See: libp2p.New.
func WithLinkSystem ¶
func WithLinkSystem(ls *ipld.LinkSystem) Option
func WithPoolName ¶
WithPoolName sets a human readable name for the pool that the blox should join or create. Required.
func WithTopicName ¶
WithTopicName sets the name of the topic onto which announcements are made. Defaults to "/explore.fula/pools/<pool-name>" if unset. See: WithPoolName.
Click to show internal directories.
Click to hide internal directories.