Documentation
¶
Index ¶
- Variables
- type AdSample
- type AdStats
- type Advertisement
- type Client
- type ClientStore
- type EntriesIterator
- type MultihashIterator
- type Option
- func WithDeleteAfterRead(del bool) Option
- func WithEntriesDepthLimit(depthLimit int64) Option
- func WithHttpTimeout(to time.Duration) Option
- func WithLibp2pHost(h host.Host) Option
- func WithMaxSyncRetry(r uint64) Option
- func WithSyncRetryBackoff(d time.Duration) Option
- func WithTopicName(topic string) Option
- type Sampler
Constants ¶
This section is empty.
Variables ¶
var ErrContentNotFound = errors.New("content not found at publisher")
Functions ¶
This section is empty.
Types ¶
type AdStats ¶
type AdStats struct {
NonRmCount int
RmCount int
AdNoLongerProvidedCount int
// contains filtered or unexported fields
}
func NewAdStats ¶
func (*AdStats) NonRmChunkStats ¶
func (a *AdStats) NonRmChunkStats() stats.Float64Data
func (*AdStats) NonRmMhStats ¶
func (a *AdStats) NonRmMhStats() stats.Float64Data
func (*AdStats) Sample ¶
func (a *AdStats) Sample(ad *Advertisement) *AdSample
func (*AdStats) TotalAdCount ¶
func (*AdStats) UniqueContextIDCount ¶
type Advertisement ¶
type Advertisement struct {
ID cid.Cid
PreviousID cid.Cid
ProviderID peer.ID
ContextID []byte
Metadata []byte
Addresses []string
Entries *EntriesIterator
IsRemove bool
ExtendedProvider *schema.ExtendedProvider
// SigErr is the signature validation error. Nil if signature is valid.
SigErr error
// SignerID is the peer.ID of the of the signer.
SignerID peer.ID
}
Advertisement contains information about a schema.Advertisement
func (*Advertisement) HasEntries ¶
func (a *Advertisement) HasEntries() bool
type Client ¶
type ClientStore ¶
type ClientStore struct {
datastore.Batching
ipld.LinkSystem
// contains filtered or unexported fields
}
type EntriesIterator ¶
type EntriesIterator struct {
// contains filtered or unexported fields
}
func (*EntriesIterator) ChunkCount ¶
func (d *EntriesIterator) ChunkCount() int
ChunkCount returns the number of current chunk in iteration. This function returns the final count of entries chunk when iteration reaches its end, i.e. calling EntriesIterator.Next returns io.EOF error.
func (*EntriesIterator) IsPresent ¶
func (d *EntriesIterator) IsPresent() bool
func (*EntriesIterator) Root ¶
func (d *EntriesIterator) Root() cid.Cid
type MultihashIterator ¶
type MultihashIterator interface {
// Next returns the next multihash in the list of mulitihashes. The
// iterator fails fast: errors that occur during iteration are returned
// immediately. This function returns a zero multihash and io.EOF when
// there are no more elements to return.
Next() (multihash.Multihash, error)
}
MultihashIterator iterates over a list of multihashes.
See: CarMultihashIterator.
type Option ¶
type Option func(*config) error
Option is a function that sets a value in a config.
func WithDeleteAfterRead ¶ added in v0.4.2
WithDeleteAfterRead deleted ifems from the store after reading them.
func WithEntriesDepthLimit ¶
WithEntriesDepthLimit sets the depth limit when syncing an advertisement entries chain. Setting to 0 means no limit.
func WithHttpTimeout ¶ added in v0.1.6
WithHttpTimeout sets the timeout for http and libp2phttp connections.
func WithLibp2pHost ¶ added in v0.0.11
WithLibp2pHost configures the client to use an existing libp2p host.
func WithMaxSyncRetry ¶
WithMaxSyncRetry sets the maximum number of times to retry a failed sync. Defaults to 10 if unset.
func WithSyncRetryBackoff ¶
WithSyncRetryBackoff sets the length of time to wait before retrying a faild sync. Defaults to 500ms if unset.
func WithTopicName ¶
WithTopicName sets the topic name on which the provider announces advertised content. Defaults to '/indexer/ingest/mainnet'.