publisher

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0, MIT Imports: 28 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,
	publisher ipnipub.Publisher,
	provider peer.AddrInfo,
	locationCommitment delegation.Delegation,
) error

Types

type Option

type Option func(*options) error

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) Serve

func (srv *Server) Serve(mux *http.ServeMux)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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