Documentation
¶
Index ¶
- func DefaultHTTPClient() *http.Client
- type Option
- func SkipNotification() Option
- func WithAsyncPublisher(asyncPublisher publisher.AsyncPublisher) Option
- func WithCachingQueue(cachingQueue providercacher.CachingQueueQueuer) Option
- func WithClaimsCacheOptions(opts ...redis.Option) Option
- func WithClaimsClient(client redis.Client) Option
- func WithClaimsStore(store types.ContentClaimsStore) Option
- func WithDataPath(dataPath string) Option
- func WithDatastore(ds datastore.Batching) Option
- func WithHTTPClient(httpClient *http.Client) Option
- func WithIndexesCacheOptions(opts ...redis.Option) Option
- func WithIndexesClient(client redis.Client) Option
- func WithLegacyClaims(legacyClaimsMappers []legacy.ContentToClaimsMapper, ...) Option
- func WithNoProvidersCacheOptions(opts ...redis.Option) Option
- func WithNoProvidersClient(client redis.Client) Option
- func WithProviderIndexLogger(log logging.EventLogger) Option
- func WithProvidersCacheOptions(opts ...redis.Option) Option
- func WithProvidersClient(client redis.PipelineClient) Option
- func WithPublisherStore(publisherStore store.PublisherStore) Option
- func WithServiceOptions(opts ...service.Option) Option
- func WithStartIPNIServer(startIPNIServer bool) Option
- type Service
- type ServiceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultHTTPClient ¶
DefaultHTTPClient creates a HTTP client with sensible defaults
Types ¶
type Option ¶
type Option func(*config) error
Option configures how the node is construct
func SkipNotification ¶
func SkipNotification() Option
SkipNotification removes setting up IPNI notification handlers
func WithAsyncPublisher ¶ added in v1.10.6
func WithAsyncPublisher(asyncPublisher publisher.AsyncPublisher) Option
WithAsyncPublisher overrides the default IPNI publisher
func WithCachingQueue ¶
func WithCachingQueue(cachingQueue providercacher.CachingQueueQueuer) Option
WithCachingQueue overrides the default caching queue for provider caching
func WithClaimsCacheOptions ¶
WithClaimsCacheOptions passes configuration to the providers cache
func WithClaimsClient ¶
WithClaimsClient configures the redis client used for caching content claims.
func WithClaimsStore ¶
func WithClaimsStore(store types.ContentClaimsStore) Option
WithClaimsStore configures the store used for content claims.
func WithDataPath ¶
WithDataPath constructs a flat FS datastore at the specified path to use for IPNI advertisements and content claims.
func WithDatastore ¶
WithDatastore uses the given datastore for storing IPNI advertisements and content claims.
func WithHTTPClient ¶
WithHTTPClient configures the HTTP client used when consuming HTTP APIs
func WithIndexesCacheOptions ¶
WithIndexesCacheOptions passes configuration to the providers cache
func WithIndexesClient ¶
WithIndexesClient configures the redis client used for caching blob indexes.
func WithLegacyClaims ¶
func WithLegacyClaims(legacyClaimsMappers []legacy.ContentToClaimsMapper, legacyClaimsBucket types.ContentClaimsStore, legacyClaimsUrl string) Option
WithLegacyClaims configures the service to find claims on legacy systems and storage
func WithNoProvidersCacheOptions ¶
WithNoProvidersCacheOptions passes configuration to the no providers cache
func WithNoProvidersClient ¶
WithNoProvidersClient configures the redis client used for caching empty provider results
func WithProviderIndexLogger ¶
func WithProviderIndexLogger(log logging.EventLogger) Option
func WithProvidersCacheOptions ¶
WithProvidersCacheOptions passes configuration to the providers cache
func WithProvidersClient ¶
func WithProvidersClient(client redis.PipelineClient) Option
WithProvidersClient configures the redis client used for caching providers.
func WithPublisherStore ¶
func WithPublisherStore(publisherStore store.PublisherStore) Option
WithPublisherStore overrides the store used for IPNI advertisements If not used with startIPNIServer = false, store.AdvertStore must implement store.FullStore
func WithServiceOptions ¶
WithServiceOptions passes option to the core service
func WithStartIPNIServer ¶
WithStartIPNIServer determines when IPNI ads will be served directly over HTTP Defaults true
type Service ¶
type Service interface {
types.Service
Startup(ctx context.Context) error
Shutdown(ctx context.Context) error
}
Service is the core methods of the indexing service but with additional lifecycle methods.
type ServiceConfig ¶
type ServiceConfig struct {
// ID configures the identity for the service. Both ID and PrivateKey are the
// same key, the difference is that ID may be wrapped as a did:web.
ID principal.Signer
// PrivateKey configures the private key for the service.
PrivateKey crypto.PrivKey
// PublicURL is the public HTTP URL(s) the indexing service is available at.
// These are used when publishing claims, to indicate that they can be
// retrieved from here, replacing the pattern "{claim}" with the CID of the
// claim that is available.
PublicURL []string
ProvidersRedis goredis.ClusterOptions
NoProviderRedis goredis.ClusterOptions
ClaimsRedis goredis.ClusterOptions
IndexesRedis goredis.ClusterOptions
// IPNIFindURL is the URL of an IPNI node to use for find queries.
IPNIFindURL string
// IPNIDirectAnnounceURLs are the URL(s) of IPNI nodes that
// advertisement announcements should be sent to. Defaults to IndexerURL if
// not set.
IPNIDirectAnnounceURLs []string
// IPNIListenAddr configures the HTTP address the publisher binds to.
// This allows a remote IPNI subscriber to fetch advertisements.
IPNIListenAddr string
// IPNIAnnounceAddrs configures the multiaddrs that are put into announce
// messages to tell indexers the addresses to fetch advertisements from.
IPNIAnnounceAddrs []string
}
ServiceConfig sets specific config values for the service