Documentation ¶
Index ¶
Constants ¶
const IPNIPath = "/ipni/v1/ad/"
IPNIPath is a constant that represents the path for IPNI API requests.
const IPNIRoutePath = "/ipni-provider/"
IPNIRoutePath is a constant representing the route path for IPNI provider.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider represents a provider for IPNI.
func NewProvider ¶
NewProvider initializes a new Provider using the provided dependencies. It retrieves private libp2p keys from the database, unmarshals them, generates peer IDs, and populates a keyMap with the corresponding peer information. It also sets up the announce URLs and HTTP server addresses based on the configuration. The Provider struct is then created with the populated fields and returned along with nil error. If any error occurs during the process, it is returned along with a non-nil Provider.
func (*Provider) StartPublishing ¶
StartPublishing starts a poller which publishes the head for each provider every 10 minutes.