storage

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0, MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(server server.ServerView[server.Service]) handler.Func

func NewUCANServer

func NewUCANServer(storageService Service, options ...server.Option) (server.ServerView[server.Service], error)

Types

type Option

type Option func(*config) error

func WithAcceptanceDatastore added in v0.0.18

func WithAcceptanceDatastore(dstore datastore.Datastore) Option

WithAcceptanceDatastore configures the underlying datastore to use for storing acceptance records. Note: the datastore MUST have efficient support for prefix queries.

func WithAcceptanceStore added in v0.0.18

func WithAcceptanceStore(acceptanceStore acceptancestore.AcceptanceStore) Option

WithAcceptanceStore configures the acceptance store directly

func WithAllocationDatastore

func WithAllocationDatastore(dstore datastore.Datastore) Option

WithAllocationDatastore configures the underlying datastore to use for storing allocation records. Note: the datastore MUST have efficient support for prefix queries.

func WithAllocationStore

func WithAllocationStore(allocationStore allocationstore.AllocationStore) Option

WithAllocationStore configures the allocation store directly

func WithAsyncPublisher added in v0.0.17

func WithAsyncPublisher(p publisher.AsyncPublisher) Option

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

func WithBlobsAccess

func WithBlobsAccess(access access.Access) Option

WithBlobsAccess configures the access instance for blob storage.

func WithBlobsPresigner

func WithBlobsPresigner(blobStorePresigner presigner.RequestPresigner) Option

WithBlobsPresigner configures the blob storage to use a set presigner

func WithBlobsPublicURL

func WithBlobsPublicURL(blobStorePublicURL url.URL) Option

WithBlobsPublicURL configures the blob storage to use a public URL

func WithBlobstore

func WithBlobstore(blobStore blobstore.Blobstore) Option

WithBlobstore configures the blob storage to use.

func WithClaimDatastore

func WithClaimDatastore(dstore datastore.Datastore) Option

WithClaimDatastore configures the underlying datastore to use for storing content claims made by this node.

func WithClaimStore

func WithClaimStore(claimStore claimstore.ClaimStore) Option

WithClaimStore configures the store for content claims directly

func WithClaimValidationContext added in v0.0.17

func WithClaimValidationContext(ctx validator.ClaimContext) Option

WithClaimValidationContext configures the validation context for use when validating UCANs.

func WithIdentity

func WithIdentity(signer principal.Signer) Option

WithIdentity configures the storage service identity, used to sign UCAN invocations and receipts.

func WithLogLevel

func WithLogLevel(name string, level string) Option

WithLogLevel changes the log level of a specific subsystem name=="*" changes all subsystems.

func WithPublicURL

func WithPublicURL(url url.URL) Option

WithPublicURL configures the URL this storage node will be publically accessible from.

func WithPublisherAnnounceAddress

func WithPublisherAnnounceAddress(addr multiaddr.Multiaddr) Option

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

func WithPublisherBlobAddress

func WithPublisherBlobAddress(addr multiaddr.Multiaddr) Option

WithPublisherBlobAddress sets the multiaddr for blobs used by the publisher

func WithPublisherDatastore

func WithPublisherDatastore(dstore datastore.Datastore) Option

WithPublisherDatastore configures the underlying datastore to use for storing IPNI advertisements and their entries.

func WithPublisherDirectAnnounce

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

WithPublisherDirectAnnounce sets IPNI node URLs to send direct HTTP announcements to.

func WithPublisherIndexingService

func WithPublisherIndexingService(conn client.Connection) Option

WithPublisherIndexingService sets the client connection to the indexing UCAN service.

func WithPublisherIndexingServiceConfig

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

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

func WithPublisherIndexingServiceProof

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

WithPublisherIndexingServiceProof configures proofs for UCAN invocations to the indexing service.

func WithPublisherStore

func WithPublisherStore(publisherStore store.PublisherStore) Option

WithPublisherStore configures the store for IPNI advertisements and their entries directly.

func WithReceiptDatastore

func WithReceiptDatastore(dstore datastore.Datastore) Option

WithReceiptDatastore configures the underlying datastore for use storing receipts made for this node

func WithReceiptStore

func WithReceiptStore(receiptStore receiptstore.ReceiptStore) Option

WithReceiptStore configures the store for receipts directly

func WithReplicatorDB added in v0.0.6

func WithReplicatorDB(db *sql.DB) Option

type Server

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

func NewServer

func NewServer(service Service, options ...server.Option) (*Server, error)

func (*Server) RegisterRoutes added in v0.0.12

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

type Service

type Service interface {
	// ID is the storage service identity, used to sign UCAN invocations and receipts.
	ID() principal.Signer
	// PDP handles PDP aggregation
	PDP() pdp.PDP
	// Blobs provides access to the blobs service.
	Blobs() blobs.Blobs
	// Claims provides access to the claims service.
	Claims() claims.Claims
	// Receipts provides access to receipts
	Receipts() receiptstore.ReceiptStore
	// Replicator provides access to the replication service
	Replicator() replicator.Replicator
	// UploadConnection provides the connection details to an upload service
	UploadConnection() client.Connection
	// ClaimValidationContext provides the context required for validating UCANs.
	ClaimValidationContext() validator.ClaimContext
}

type StorageService

type StorageService struct {
	io.Closer
	// contains filtered or unexported fields
}

func New

func New(uploadServiceConn client.Connection, opts ...Option) (*StorageService, error)

func (*StorageService) Blobs

func (s *StorageService) Blobs() blobs.Blobs

func (*StorageService) ClaimValidationContext added in v0.0.17

func (s *StorageService) ClaimValidationContext() validator.ClaimContext

func (*StorageService) Claims

func (s *StorageService) Claims() claims.Claims

func (*StorageService) Close

func (s *StorageService) Close(ctx context.Context) error

func (*StorageService) ID

func (*StorageService) PDP

func (s *StorageService) PDP() pdp.PDP

func (*StorageService) Receipts

func (*StorageService) Replicator

func (s *StorageService) Replicator() replicator.Replicator

func (*StorageService) Startup

func (s *StorageService) Startup(ctx context.Context) error

func (*StorageService) UploadConnection

func (s *StorageService) UploadConnection() client.Connection

Directories

Path Synopsis
handlers

Jump to

Keyboard shortcuts

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