ipni_provider

package
v1.24.3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0, MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const IPNIPath = "/ipni/v1/ad/"

IPNIPath is a constant that represents the path for IPNI API requests.

View Source
const IPNIRoutePath = "/ipni-provider/"

IPNIRoutePath is a constant representing the route path for IPNI provider.

Variables

This section is empty.

Functions

func Routes

func Routes(r *chi.Mux, p *Provider)

Routes sets up the routes for the IPNI provider. It registers a handler function for the GET request at the IPNIRoutePath. The handler function is provided by the Provider struct.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider represents a provider for IPNI.

func NewProvider

func NewProvider(d *deps.Deps) (*Provider, error)

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

func (p *Provider) StartPublishing(ctx context.Context)

StartPublishing starts a poller which publishes the head for each provider every 10 minutes.

Jump to

Keyboard shortcuts

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