Documentation ¶
Index ¶
- func Backup(rawPaths []string, serviceCh UploadServiceFactory)
- func BackupDB()
- func DBKey() []byte
- func DryBackup(rawPaths []string)
- func Mnemonic(key []byte)
- type BlobPlan
- type File
- type FileStatus
- type HashPlan
- type Planned
- type ScannerTransactionContext
- type Stats
- type UploadService
- type UploadServiceFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Backup ¶
func Backup(rawPaths []string, serviceCh UploadServiceFactory)
Types ¶
type FileStatus ¶
type FileStatus struct { // no enums lol Modified bool New bool Hash []byte // contains filtered or unexported fields }
func CompareFileToDb ¶
type ScannerTransactionContext ¶
type ScannerTransactionContext struct {
// contains filtered or unexported fields
}
func (*ScannerTransactionContext) Close ¶
func (ctx *ScannerTransactionContext) Close()
func (*ScannerTransactionContext) Tx ¶
func (ctx *ScannerTransactionContext) Tx() *sql.Tx
leaving a single transaction open for the entire backup process causes the WAL to grow unboundedly see issue #31 this fixes that issue by committing and reopening the transaction once a second
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
func (*Stats) Add ¶
func (s *Stats) Add(hs *utils.HasherSizer)
func (*Stats) AddCurrentlyUploading ¶
func (s *Stats) AddCurrentlyUploading(path string, sizer *utils.HasherSizer)
func (*Stats) CurrentlyUploading ¶
func (*Stats) FinishedUploading ¶
type UploadService ¶
type UploadService interface { Begin(blobID []byte) io.Writer End(sha256 []byte, size int64) []storage_base.UploadedBlob }
an abstraction over uploading to our storage destinations can either be a direct upload, or go through a gb relay (see the relay package) stateful, End must be called after Begin (so, obviously, cannot be used from multiple threads) can be reused sequentially, though
func BeginDirectUpload ¶
func BeginDirectUpload(storages []storage_base.Storage) UploadService
type UploadServiceFactory ¶
type UploadServiceFactory chan UploadService
since only one UploadService can be used per uploader thread, this provides however many are needed (aka: the number of configured uploader threads)
func MakeDefaultServiceFactory ¶
func MakeDefaultServiceFactory() UploadServiceFactory
Click to show internal directories.
Click to hide internal directories.