internal

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0, MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdSample

type AdSample struct {
	IsRemove         bool
	NoLongerProvided bool

	PartiallySynced bool
	SyncErr         error
	ChunkCount      int
	MhCount         int
	MhSample        []multihash.Multihash
	// contains filtered or unexported fields
}

type AdStats

type AdStats struct {
	NonRmCount              int
	RmCount                 int
	AdNoLongerProvidedCount int
	// contains filtered or unexported fields
}

func NewAdStats

func NewAdStats(s Sampler) *AdStats

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 (a *AdStats) TotalAdCount() int

func (*AdStats) UniqueContextIDCount

func (a *AdStats) UniqueContextIDCount() int
type Advertisement struct {
	ID               cid.Cid
	PreviousID       cid.Cid
	ProviderID       peer.ID
	ContextID        []byte
	Metadata         []byte
	Addresses        []string
	Signature        []byte
	Entries          *EntriesIterator
	IsRemove         bool
	ExtendedProvider *schema.ExtendedProvider
}

func (*Advertisement) HasEntries

func (a *Advertisement) HasEntries() bool

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) Drain

func (d *EntriesIterator) Drain() ([]multihash.Multihash, error)

func (*EntriesIterator) IsPresent

func (d *EntriesIterator) IsPresent() bool

func (*EntriesIterator) Next

func (d *EntriesIterator) Next() (multihash.Multihash, error)

func (*EntriesIterator) Root

func (d *EntriesIterator) Root() cid.Cid

type Option

type Option func(*options) error

func WithEntriesRecursionLimit

func WithEntriesRecursionLimit(limit selector.RecursionLimit) Option

WithEntriesRecursionLimit sets the recursion limit when syncing advertisement entries chain. Defaults to no limit.

func WithMaxSyncRetry

func WithMaxSyncRetry(r uint64) Option

WithMaxSyncRetry sets the maximum number of times to retry a failed sync. Defaults to 10 if unset.

func WithSyncRetryBackoff

func WithSyncRetryBackoff(d time.Duration) Option

WithSyncRetryBackoff sets the length of time to wait before retrying a faild sync. Defaults to 500ms if unset.

func WithTopicName

func WithTopicName(topic string) Option

WithTopicName sets the topic name on which the provider announces advertised content. Defaults to '/indexer/ingest/mainnet'.

type ProviderClient

type ProviderClient interface {
	GetAdvertisement(ctx context.Context, id cid.Cid) (*Advertisement, error)
	Close() error
}

func NewProviderClient

func NewProviderClient(provAddr peer.AddrInfo, o ...Option) (ProviderClient, error)

type ProviderClientStore

type ProviderClientStore struct {
	datastore.Batching
	ipld.LinkSystem
}

type Sampler

type Sampler func() bool

type VerifyIngestResult

type VerifyIngestResult struct {
	TotalMhChecked   int
	ProviderMismatch int
	Present          int
	Absent           int
	FailedToVerify   int
	Errs             []error
	AbsentMhs        []multihash.Multihash
}

func VerifyIngestFromMhs

func VerifyIngestFromMhs(finder *httpfinderclient.Client, wantProvID string, mhs []multihash.Multihash) (*VerifyIngestResult, error)

func (*VerifyIngestResult) Add

func (r *VerifyIngestResult) Add(other *VerifyIngestResult)

func (*VerifyIngestResult) PassedVerification

func (r *VerifyIngestResult) PassedVerification() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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