Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ID principal.Signer // StorageNodeID is the DID of the storage node. StorageNodeID ucan.Principal // StorageNodeURL is the URL of the storage node UCAN endpoint. StorageNodeURL url.URL // StorageProof is a delegation allowing the upload service to invoke // blob/allocate and blob/accept on the storage node. StorageProof delegation.Proof }
type UploadService ¶
type UploadService struct {
// contains filtered or unexported fields
}
UploadService simulates actions taken by the upload service in response to client invocations.
func NewService ¶
func NewService(t *testing.T, cfg Config) *UploadService
func (*UploadService) BlobAdd ¶
func (s *UploadService) BlobAdd(t *testing.T, space did.DID, digest multihash.Multihash, size uint64) *blob.Address
BlobAdd simulates a blob/add invocation from a client to the upload service. It sends a blob/allocate invocation to the storage node and returns the upload address if required (i.e. it may be nil if the storage node already has the blob).
func (*UploadService) ConcludeHTTPPut ¶
func (s *UploadService) ConcludeHTTPPut(t *testing.T, space did.DID, digest multihash.Multihash, size uint64) delegation.Delegation
ConcludeHTTPPut simulates a ucan/conclude invocation for a http/put receipt from the client. It sends a blob/accept invocation to the storage node and returns the location commitment.
Click to show internal directories.
Click to hide internal directories.