Documentation
¶
Index ¶
- func WriteUploadToDatabase(writer UploadWriter, upload *Upload) error
- type Upload
- func (u *Upload) CreatedAt() time.Time
- func (u *Upload) HasRootFSEntryID() bool
- func (u *Upload) ID() id.UploadID
- func (u *Upload) Invalidate() error
- func (u *Upload) RootCID() cid.Cid
- func (u *Upload) RootFSEntryID() id.FSEntryID
- func (u *Upload) SetRootCID(rootCID cid.Cid) error
- func (u *Upload) SetRootFSEntryID(rootFSEntryID id.FSEntryID) error
- func (u *Upload) SourceID() id.SourceID
- func (u *Upload) SpaceDID() did.DID
- type UploadScanner
- type UploadWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteUploadToDatabase ¶
func WriteUploadToDatabase(writer UploadWriter, upload *Upload) error
WriteUploadToDatabase writes an upload to the database using the provided writer function.
Types ¶
type Upload ¶
type Upload struct {
// contains filtered or unexported fields
}
Upload represents the process of full or partial upload of data from a source, eventually represented as an upload in storacha.
func ReadUploadFromDatabase ¶
func ReadUploadFromDatabase(scanner UploadScanner) (*Upload, error)
ReadUploadFromDatabase reads an upload from the database using the provided scanner function.
func (*Upload) HasRootFSEntryID ¶
func (*Upload) Invalidate ¶
Invalidate clears the root CID and root FSEntryID of the upload, meaning that it needs to be scanned again.
func (*Upload) RootFSEntryID ¶
func (*Upload) SetRootFSEntryID ¶
type UploadScanner ¶
type UploadScanner func(id *id.UploadID, spaceDID *did.DID, sourceID *id.SourceID, createdAt *time.Time, updatedAt *time.Time, rootFSEntryID *id.FSEntryID, rootCID *cid.Cid) error
UploadScanner is a function type that defines the signature for scanning uploads from a database row
Click to show internal directories.
Click to hide internal directories.