namesys

package module
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: MIT Imports: 16 Imported by: 0

README

go-libp2p-pubsub-router

standard-readme compliant GoDoc Coverage Status Build Status

A libp2p router that uses pubsub.

We currently only use this for IPNS over PubSub.

Documenation

See https://godoc.org/github.com/libp2p/go-libp2p-pubsub-router.

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

Want to hack on IPFS?

License

MIT

Documentation

Index

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) GetValue

func (p *PubsubValueStore) GetValue(ctx context.Context, key string, opts ...ropts.Option) ([]byte, error)

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

Jump to

Keyboard shortcuts

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