Documentation
¶
Index ¶
- func RetryWithBackoff(f func() error, initialInterval time.Duration, times int) error
- type Option
- type Options
- type ReframeListener
- func (listener *ReframeListener) FindProviders(ctx context.Context, key cid.Cid) (<-chan client.FindProvidersAsyncResult, error)
- func (listener *ReframeListener) GetIPNS(ctx context.Context, id []byte) (<-chan client.GetIPNSAsyncResult, error)
- func (listener *ReframeListener) Provide(ctx context.Context, pr *client.ProvideRequest) (<-chan client.ProvideAsyncResult, error)
- func (listener *ReframeListener) PutIPNS(ctx context.Context, id []byte, record []byte) (<-chan client.PutIPNSAsyncResult, error)
- func (listener *ReframeListener) Shutdown()
- type ReframeMultihashLister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶ added in v0.9.1
type Option func(*Options)
func WithSnapshotMaxChunkSize ¶ added in v0.9.1
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
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)
Click to show internal directories.
Click to hide internal directories.