storage

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: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(server server.ServerView) func(http.ResponseWriter, *http.Request)

func NewUCANServer

func NewUCANServer(storageService Service) (server.ServerView, error)

Types

type AllocatedMemoryNotWrittenError

type AllocatedMemoryNotWrittenError struct{}

func NewAllocatedMemoryNotWrittenError

func NewAllocatedMemoryNotWrittenError() AllocatedMemoryNotWrittenError

func (AllocatedMemoryNotWrittenError) Error

func (AllocatedMemoryNotWrittenError) Name

type BlobSizeLimitExceededError

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

func NewBlobSizeLimitExceededError

func NewBlobSizeLimitExceededError(size uint64, max uint64) BlobSizeLimitExceededError

func (BlobSizeLimitExceededError) Error

func (BlobSizeLimitExceededError) Name

type Option

type Option func(*config) error

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 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 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 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.

type Server

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

func NewServer

func NewServer(service Service) (*Server, error)

func (*Server) Serve

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

type Service

type Service interface {
	// ID is the storage service identity, used to sign UCAN invocations and receipts.
	ID() principal.Signer
	// Blobs provides access to the blobs service.
	Blobs() blobs.Blobs
	// Claims provides access to the claims service.
	Claims() claims.Claims
}

type StorageService

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

func New

func New(opts ...Option) (*StorageService, error)

func (*StorageService) Blobs

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

func (*StorageService) Claims

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

func (*StorageService) Close

func (s *StorageService) Close() error

func (*StorageService) ID

type UnsupportedCapabilityError

type UnsupportedCapabilityError[C any] struct {
	// contains filtered or unexported fields
}

func NewUnsupportedCapabilityError

func NewUnsupportedCapabilityError[C any](capability ucan.Capability[C]) UnsupportedCapabilityError[C]

func (UnsupportedCapabilityError[C]) Capability

func (ue UnsupportedCapabilityError[C]) Capability() ucan.Capability[C]

func (UnsupportedCapabilityError[C]) Error

func (ue UnsupportedCapabilityError[C]) Error() string

func (UnsupportedCapabilityError[C]) Name

func (ue UnsupportedCapabilityError[C]) Name() string

Jump to

Keyboard shortcuts

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