Documentation
¶
Overview ¶
This package stores files in AWS S3 (and metadata in DynamoDB), allowing for incremental writes of multiple of BlockSize. For each file it stores a "metadata" record and a series of "block" records. Files and data expire after a predefined TTL.
This package stores files in BadgerDB, allowing for incremental writes of multiple of BlockSize. For each file it stores a "metadata" record and a series of "block" records. Files and data expire after a predefined TTL.
This package stores files in BadgerDB, allowing for incremental writes of multiple of BlockSize. For each file it stores a "metadata" record and a series of "block" records. Files and data expire after a predefined TTL.
Index ¶
Constants ¶
const ( BlockSize = 16 * 1024 FileComplete int64 = -1 InvalidPos int64 = -2 )
Variables ¶
Functions ¶
Types ¶
type FileInfo ¶
type FileInfo struct {
Name string
ContentType string
Hash string
Length int64
Next int64
Created time.Time
ExpiresAt time.Time
}
User file info, returned by Stat
type StorageDB ¶
type StorageDB interface {
CreateFile(key, filename, ctype string, size int64, hash []byte) error
DeleteFile(key string) error
Close() error
WriteAt(key string, pos int64, data []byte) (int64, error)
ReadAt(key string, buf []byte, pos int64) (int64, error)
Stat(key string) (*FileInfo, error)
GC() error
Scan(start string) error
}
The interface to storage services