reframe

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0, MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RetryWithBackoff

func RetryWithBackoff(f func() error, initialInterval time.Duration, times int) error

Types

type Option added in v0.9.1

type Option func(*Options)

func WithSnapshotMaxChunkSize added in v0.9.1

func WithSnapshotMaxChunkSize(i int) Option

type Options added in v0.9.1

type Options struct {
	// SnapshotMaxChunkSize defines a size of a chunk that CID snapshot is going to be split into before stored in the datastore.
	// Needed as leveldb can't handle binary payloads above a certain threshold
	SnapshotMaxChunkSize int
}

func ApplyOptions added in v0.9.1

func ApplyOptions(opt ...Option) Options

type ReframeListener

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

func New

func New(ctx context.Context, engine provider.Interface,
	cidTtl time.Duration,
	chunkSize int,
	snapshotSize int,
	providerId string,
	addresses []string,
	ds datastore.Datastore,
	nonceGen func() []byte,
	opts ...Option,
) (*ReframeListener, error)

NewReframeListenerWithNonceGen creates a reframe listener and initialises its state from the provided datastore.

func (*ReframeListener) FindProviders

func (listener *ReframeListener) FindProviders(ctx context.Context, key cid.Cid) (<-chan client.FindProvidersAsyncResult, error)

func (*ReframeListener) GetIPNS

func (listener *ReframeListener) GetIPNS(ctx context.Context, id []byte) (<-chan client.GetIPNSAsyncResult, error)

func (*ReframeListener) Provide

func (listener *ReframeListener) Provide(ctx context.Context, pr *client.ProvideRequest) (<-chan client.ProvideAsyncResult, error)

func (*ReframeListener) PutIPNS

func (listener *ReframeListener) PutIPNS(ctx context.Context, id []byte, record []byte) (<-chan client.PutIPNSAsyncResult, error)

func (*ReframeListener) Shutdown

func (listener *ReframeListener) Shutdown()

type ReframeMultihashLister

type ReframeMultihashLister struct {
	CidFetcher func(contextID []byte) (map[cid.Cid]struct{}, error)
}

func (*ReframeMultihashLister) MultihashLister

func (lister *ReframeMultihashLister) MultihashLister(ctx context.Context, p peer.ID, contextID []byte) (provider.MultihashIterator, error)

Jump to

Keyboard shortcuts

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