publisher

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0, MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheClaim

func CacheClaim(
	ctx context.Context,
	id principal.Signer,
	indexingService client.Connection,
	invocationProofs delegation.Proofs,
	clm delegation.Delegation,
	providerAddresses []multiaddr.Multiaddr,
) error

func PublishLocationCommitment

func PublishLocationCommitment(
	ctx context.Context,
	asyncPublisher ipnipub.AsyncPublisher,
	provider peer.AddrInfo,
	locationCommitment delegation.Delegation,
) error

Types

type Option

type Option func(*options) error

func WithAnnounceAddress

func WithAnnounceAddress(addr multiaddr.Multiaddr) Option

WithAnnounceAddress sets the address put into announce messages to tell indexers where to fetch advertisements from.

func WithAsyncPublisher added in v0.0.17

func WithAsyncPublisher(p ipnipub.AsyncPublisher) Option

WithAsyncPublisher configures the async publisher for IPNI advertisements (overrides any publisher specific config)

func WithBlobAddress

func WithBlobAddress(addr multiaddr.Multiaddr) Option

WithBlobAddress sets a custom address to tell indexers where to fetch blobs from

func WithDirectAnnounce

func WithDirectAnnounce(announceURLs ...url.URL) Option

WithDirectAnnounce sets indexer URLs to send direct HTTP announcements to.

func WithIndexingService

func WithIndexingService(conn client.Connection) Option

WithIndexingService sets the client connection to the indexing UCAN service.

func WithIndexingServiceConfig

func WithIndexingServiceConfig(serviceDID ucan.Principal, serviceURL url.URL) Option

WithIndexingServiceConfig configures UCAN service invocation details for communicating with the indexing service.

func WithIndexingServiceProof

func WithIndexingServiceProof(proof ...delegation.Proof) Option

WithIndexingServiceProof configures proofs for UCAN invocations to the indexing service.

func WithLogLevel

func WithLogLevel(level string) Option

WithLogLevel changes the log level for the publisher subsystem.

type Publisher

type Publisher interface {
	// Store is the storage interface for published advertisements.
	Store() store.PublisherStore
	// Publish advertises content claims/commitments found on this node to the
	// storacha network.
	Publish(context.Context, delegation.Delegation) error
}

type PublisherService

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

func New

func New(
	id principal.Signer,
	publisherStore store.PublisherStore,
	publicAddr multiaddr.Multiaddr,
	opts ...Option,
) (*PublisherService, error)

New creates a Publisher that publishes content claims/commitments to IPNI and caches them with the indexing service.

The publicAddr parameter is the base public address where adverts and claims can be read from. When publishing, the address is suffixed with a /http-path/<path> multiaddr, where "path" is the URI encoded version of the configured claim path.

Note: publicAddr address must be HTTP(S).

func (*PublisherService) Publish

func (pub *PublisherService) Publish(ctx context.Context, claim delegation.Delegation) error

func (*PublisherService) Store

func (pub *PublisherService) Store() store.PublisherStore

type Server

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

func NewServer

func NewServer(store store.EncodeableStore) (*Server, error)

func (*Server) RegisterRoutes added in v0.0.12

func (srv *Server) RegisterRoutes(e *echo.Echo)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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