Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidContinuationToken = errors.New("invalid continuation token") ErrRecordNotFound = errors.New("record not found") ErrStagedRecordNotFound = errors.New("staged metadata not found - was StageBlobMetadata() called beforehand?") ErrBlobNotFound = errors.New("the blob was not found in the store") ErrExistingDatabaseSchemaNewer = errors.New("the existing database schema is newer that what the server supports") )
Functions ¶
func CollectGarbage ¶
func CollectGarbage(ctx context.Context, db MetadataDatabase, store BlobStore, olderThan time.Time) error
When we write a blob, we first stage it in the metadata database, then write it to the blob store, then promote the staged metadata to completed. If the write fails to the blob store, we delete the staged metadata. But if the process crashes after the blob write but before we can complete the metadata, there will be orphaned blobs in the blob store. This function deletes these orphaned blobs from the blob store and their corresponding staged records in the medatada database.
func UnixTimeMsToTime ¶
Types ¶
type ContinutationToken ¶
type ContinutationToken string
type MetadataDatabase ¶
type MetadataDatabase interface { StageBlobMetadata(ctx context.Context, key BlobKey, tags *BlobTags) (*BlobInfo, error) CompleteStagedBlobMetadata(ctx context.Context, key BlobKey) error DeleteBlobMetadata(ctx context.Context, key BlobKey) error GetPageOfExpiredBlobMetadata(ctx context.Context, olderThan time.Time) ([]BlobKey, error) GetBlobMetadata(ctx context.Context, key BlobKey, expiresAfter time.Time) (*BlobInfo, error) SearchBlobMetadata(ctx context.Context, tags map[string][]string, at *time.Time, ct *ContinutationToken, pageSize int, expiresAfter time.Time) ([]BlobInfo, *ContinutationToken, error) HealthCheck(ctx context.Context) error }
Click to show internal directories.
Click to hide internal directories.