reprovide

package
v0.4.12-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyChanFunc added in v0.4.11

type KeyChanFunc func(context.Context) (<-chan *cid.Cid, error)

KeyChanFunc is function streaming CIDs to pass to content routing

func NewBlockstoreProvider added in v0.4.11

func NewBlockstoreProvider(bstore blocks.Blockstore) KeyChanFunc

NewBlockstoreProvider returns key provider using bstore.AllKeysChan

func NewPinnedProvider added in v0.4.11

func NewPinnedProvider(pinning pin.Pinner, dag merkledag.DAGService, onlyRoots bool) KeyChanFunc

NewPinnedProvider returns provider supplying pinned keys

type Reprovider

type Reprovider struct {
	// contains filtered or unexported fields
}

func NewReprovider

func NewReprovider(ctx context.Context, rsys routing.ContentRouting, keyProvider KeyChanFunc) *Reprovider

NewReprovider creates new Reprovider instance.

func (*Reprovider) Reprovide

func (rp *Reprovider) Reprovide() error

Reprovide registers all keys given by rp.keyProvider to libp2p content routing

func (*Reprovider) Run added in v0.4.11

func (rp *Reprovider) Run(tick time.Duration)

Run re-provides keys with 'tick' interval or when triggered

func (*Reprovider) Trigger added in v0.4.11

func (rp *Reprovider) Trigger(ctx context.Context) error

Trigger starts reprovision process in rp.Run and waits for it

Jump to

Keyboard shortcuts

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