Documentation ¶
Index ¶
- func RetryWithBackoff(f func() error, initialInterval time.Duration, times int) error
- type Listener
- func (listener *Listener) FindIPNSRecord(ctx context.Context, name ipns.Name) (*ipns.Record, error)
- func (listener *Listener) FindPeers(ctx context.Context, pid peer.ID, limit int) (iter.ResultIter[*types.PeerRecord], error)
- func (listener *Listener) FindProviders(ctx context.Context, key cid.Cid, limit int) (iter.ResultIter[types.Record], error)
- func (listener *Listener) GetIPNS(ctx context.Context, name ipns.Name) (*ipns.Record, error)
- func (listener *Listener) ProvideBitswap(ctx context.Context, req *server.BitswapWriteProvideRequest) (time.Duration, error)
- func (listener *Listener) ProvideIPNSRecord(ctx context.Context, name ipns.Name, record *ipns.Record) error
- func (listener *Listener) PutIPNS(ctx context.Context, name ipns.Name, record *ipns.Record) error
- func (listener *Listener) Shutdown()
- type MultihashLister
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Listener ¶
type Listener 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, ) (*Listener, error)
New creates a delegated routing listener and initialises its state from the provided datastore.
func (*Listener) FindIPNSRecord ¶ added in v0.14.0
func (*Listener) FindProviders ¶
func (*Listener) ProvideBitswap ¶
func (*Listener) ProvideIPNSRecord ¶ added in v0.14.0
type MultihashLister ¶
func (*MultihashLister) MultihashLister ¶
func (lister *MultihashLister) MultihashLister(ctx context.Context, p peer.ID, contextID []byte) (provider.MultihashIterator, error)
type Option ¶
type Option func(*Options)
func WithAdFlushFrequency ¶ added in v0.13.1
func WithPageSize ¶
type Options ¶
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 // PageSize defines a maximum number of results that can be returned by a // query during datastore initialisation PageSize int // AdFlushFrequency defines a frequency of a flush operation that is going // to be performed on the current chunk. In other words a non empty current // chunk will be converted to an ad and published. AdFlushFrequency time.Duration }
func ApplyOptions ¶
Click to show internal directories.
Click to hide internal directories.