Documentation ¶
Index ¶
- type PubsubValueStore
- func (p *PubsubValueStore) Cancel(name string) bool
- func (p *PubsubValueStore) GetSubscriptions() []string
- func (p *PubsubValueStore) GetValue(ctx context.Context, key string, opts ...ropts.Option) ([]byte, error)
- func (p *PubsubValueStore) PutValue(ctx context.Context, key string, value []byte, opts ...ropts.Option) error
- func (p *PubsubValueStore) Subscribe(key string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PubsubValueStore ¶
type PubsubValueStore struct { Validator record.Validator // contains filtered or unexported fields }
func NewPubsubValueStore ¶
func NewPubsubValueStore(ctx context.Context, host p2phost.Host, cr routing.ContentRouting, ps *floodsub.PubSub, validator record.Validator) *PubsubValueStore
NewPubsubPublisher constructs a new Publisher that publishes IPNS records through pubsub. The constructor interface is complicated by the need to bootstrap the pubsub topic. This could be greatly simplified if the pubsub implementation handled bootstrap itself
func (*PubsubValueStore) Cancel ¶
func (p *PubsubValueStore) Cancel(name string) bool
Cancel cancels a topic subscription; returns true if an active subscription was canceled
func (*PubsubValueStore) GetSubscriptions ¶
func (p *PubsubValueStore) GetSubscriptions() []string
GetSubscriptions retrieves a list of active topic subscriptions
func (*PubsubValueStore) PutValue ¶
func (p *PubsubValueStore) PutValue(ctx context.Context, key string, value []byte, opts ...ropts.Option) error
Publish publishes an IPNS record through pubsub with default TTL
func (*PubsubValueStore) Subscribe ¶
func (p *PubsubValueStore) Subscribe(key string) error
Click to show internal directories.
Click to hide internal directories.