Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunDistanceTracker ¶
Types ¶
type AdDistance ¶ added in v0.1.0
type AdDistance struct {
// contains filtered or unexported fields
}
AdDistance finds the distance between advertisements on an IPNI advertisement chain.
func NewAdDistance ¶ added in v0.1.0
func NewAdDistance(options ...Option) (*AdDistance, error)
NewAdDistance creates a new advertisement chain distance finder.
func (*AdDistance) Close ¶ added in v0.1.0
func (a *AdDistance) Close() error
Close closes the internal dagsync subscriber and the libp2p host if owned by this AdDistance instance.
func (*AdDistance) Get ¶ added in v0.1.0
func (a *AdDistance) Get(ctx context.Context, publisher peer.AddrInfo, oldestCid, newestCid cid.Cid) (int, cid.Cid, error)
Get returns the number af advertisements from the newest to the oldest advertisement on an IPNI advertisement chain. If newestCid is cid.Undef, then it referrs to the current head of the chain, and the head CID is returned as the 2nd return value.
type Option ¶ added in v0.1.0
type Option func(*config)
func WithDepthLimit ¶ added in v0.1.0
WithDepthLimit configures the advertisement chain depth limit.
func WithP2pHost ¶ added in v0.1.11
WithP2pHost configures the libp2p host to use for connection to the advertisement publisher.