Documentation ΒΆ
Index ΒΆ
- Constants
- Variables
- func DecodeArchive(progress chan<- Progress, repository Repository, arc Archive, path string) error
- func DecodeSnapshot(repository Repository, snapshot *Snapshot, dst string, excludes []string, ...) (<-chan Progress, error)
- func Hash(b []byte, hashtype uint8) string
- func ReadArchive(repository Repository, arc Archive, offset int, size int) (*[]byte, error)
- func RegisterStorageBackend(factory BackendFactory)
- func SetLogger(l Logger)
- func SizeToString(size uint64) (str string)
- func SubDirForChunk(id string) string
- func VerifyArchive(repository Repository, arc Archive) error
- func VerifyRepo(repository Repository, percentage int) (<-chan Progress, error)
- func VerifySnapshot(repository Repository, snapshotId string, percentage int) (<-chan Progress, error)
- func VerifyVolume(repository Repository, volumeId string, percentage int) (<-chan Progress, error)
- type Archive
- type ArchiveResult
- type Backend
- type BackendFactory
- type BackendFilesystem
- type BackendManager
- func (backend *BackendManager) AddBackend(be *Backend)
- func (backend *BackendManager) DeleteChunk(shasum string, part, totalParts uint) error
- func (backend *BackendManager) InitRepository() error
- func (backend *BackendManager) LoadChunk(chunk Chunk, part uint) ([]byte, error)
- func (backend *BackendManager) LoadChunkIndex() ([]byte, error)
- func (backend *BackendManager) LoadRepository() ([]byte, error)
- func (backend *BackendManager) LoadSnapshot(id string) ([]byte, error)
- func (backend *BackendManager) Locations() []string
- func (backend *BackendManager) SaveChunkIndex(b []byte) error
- func (backend *BackendManager) SaveRepository(b []byte) error
- func (backend *BackendManager) SaveSnapshot(id string, b []byte) error
- func (backend *BackendManager) StoreChunk(chunk Chunk) (size uint64, err error)
- type CheckSumError
- type Chunk
- type ChunkError
- type ChunkIndex
- type ChunkIndexItem
- type ChunkResult
- type Compressor
- type DataReconstructionError
- type Decompressor
- type Decryptor
- type Encryptor
- type LogLevel
- type Logger
- type NopLogger
- func (nl NopLogger) Debug(v ...interface{})
- func (nl NopLogger) Debugf(format string, v ...interface{})
- func (nl NopLogger) Fatal(v ...interface{})
- func (nl NopLogger) Fatalf(format string, v ...interface{})
- func (nl NopLogger) Info(v ...interface{})
- func (nl NopLogger) Infof(format string, v ...interface{})
- func (nl NopLogger) Print(v ...interface{})
- func (nl NopLogger) Printf(format string, v ...interface{})
- func (nl NopLogger) Warn(v ...interface{})
- func (nl NopLogger) Warnf(format string, v ...interface{})
- type Pipeline
- type PipelineProcessor
- type Progress
- type Repository
- func (r *Repository) AddVolume(volume *Volume) error
- func (r *Repository) BackendManager() *BackendManager
- func (r *Repository) ChangeLocation(oldLocation, newLocation string) error
- func (r *Repository) ChangePassword(newPassword string) error
- func (r *Repository) FindSnapshot(id string) (*Volume, *Snapshot, error)
- func (r *Repository) FindVolume(id string) (*Volume, error)
- func (r *Repository) IsEmpty() bool
- func (r *Repository) Migrate() error
- func (r *Repository) RemoveVolume(volume *Volume) error
- func (r *Repository) Save() error
- type SeekError
- type Snapshot
- type Stats
- type StorageFilesystem
- func (backend StorageFilesystem) DeleteChunk(shasum string, part, totalParts uint) error
- func (backend StorageFilesystem) InitRepository() error
- func (backend StorageFilesystem) LoadChunk(shasum string, part, totalParts uint) ([]byte, error)
- func (backend StorageFilesystem) LoadChunkIndex() ([]byte, error)
- func (backend StorageFilesystem) LoadRepository() ([]byte, error)
- func (backend StorageFilesystem) LoadSnapshot(id string) ([]byte, error)
- func (backend StorageFilesystem) SaveChunkIndex(b []byte) error
- func (backend StorageFilesystem) SaveRepository(b []byte) error
- func (backend StorageFilesystem) SaveSnapshot(id string, b []byte) error
- func (backend StorageFilesystem) StoreChunk(shasum string, part, totalParts uint, data []byte) (size uint64, err error)
- type StorageLocal
- func (backend *StorageLocal) AvailableSpace() (uint64, error)
- func (backend *StorageLocal) Close() error
- func (backend *StorageLocal) CreatePath(path string) error
- func (backend StorageLocal) DeleteFile(path string) error
- func (backend *StorageLocal) Description() string
- func (backend *StorageLocal) Location() string
- func (*StorageLocal) NewBackend(u url.URL) (Backend, error)
- func (backend *StorageLocal) Protocols() []string
- func (backend StorageLocal) ReadFile(path string) ([]byte, error)
- func (backend StorageLocal) Stat(path string) (uint64, error)
- func (backend StorageLocal) WriteFile(path string, data []byte) (size uint64, err error)
- type StoreOptions
- type Volume
Constants ΒΆ
const ( File = iota // A File Directory // A Directory SymLink // A SymLink )
Types of archives.
const ( CompressionNone = iota CompressionGZip CompressionLZMA CompressionFlate CompressionZlib CompressionZstd )
Available compression algos.
const ( EncryptionNone = iota EncryptionAES )
Available encryption algos.
const ( HashSha256 = iota HashHighway256 )
Available hash algos.
const ( LogLevelFatal = iota LogLevelWarning LogLevelPrint LogLevelInfo LogLevelDebug )
const ( // RepoFilename is the default filename for the repository data. RepoFilename = "repository.knoxite" // ChunkIndexFilename is the default filename for the chunk-index. ChunkIndexFilename = "index" )
const (
RepositoryVersion = 4
)
Const declarations.
Variables ΒΆ
var ( ErrRepositoryExists = errors.New("repository seems to already exist") ErrInvalidRepositoryURL = errors.New("invalid repository url specified") ErrAvailableSpaceUnknown = errors.New("available space is unknown or undefined") ErrAvailableSpaceUnlimited = errors.New("available space is unlimited") ErrInvalidUsername = errors.New("username wrong or missing") )
Error declarations.
var ( ErrLoadChunkFailed = errors.New("unable to load chunk from any storage backend") ErrLoadSnapshotFailed = errors.New("unable to load snapshot from any storage backend") ErrLoadChunkIndexFailed = errors.New("unable to load chunk-index from any storage backend") ErrLoadRepositoryFailed = errors.New("unable to load repository from any storage backend") ErrDeleteChunkFailed = errors.New("unable to delete chunk from any storage backend") ErrStoreChunkFailed = errors.New("storing chunk failed") ErrStoreSnapshotFailed = errors.New("storing snapshot failed") ErrStoreChunkIndexFailed = errors.New("storing chunk-index failed") ErrStoreRepositoryFailed = errors.New("storing repository failed") )
Error declarations.
var ( ErrRepositoryIncompatible = errors.New("the repository is not compatible with this version of Knoxite") ErrOpenRepositoryFailed = errors.New("wrong password or corrupted repository") ErrVolumeNotFound = errors.New("volume not found") ErrSnapshotNotFound = errors.New("snapshot not found") ErrGenerateRandomKeyFailed = errors.New("failed to generate a random encryption key for new repository") )
Error declarations.
var (
ErrInvalidPassword = errors.New("empty password not permitted")
)
Error declarations.
Functions ΒΆ
func DecodeArchive ΒΆ
func DecodeArchive(progress chan<- Progress, repository Repository, arc Archive, path string) error
DecodeArchive restores a single archive to path.
func DecodeSnapshot ΒΆ
func DecodeSnapshot(repository Repository, snapshot *Snapshot, dst string, excludes []string, pedantic bool) (<-chan Progress, error)
DecodeSnapshot restores an entire snapshot to dst.
func ReadArchive ΒΆ
ReadArchive reads from an archive.
func RegisterStorageBackend ΒΆ
func RegisterStorageBackend(factory BackendFactory)
RegisterStorageBackend needs to be called by storage backends to register themselves.
func SubDirForChunk ΒΆ
SubDirForChunk files a chunk into a subdir, based on the chunks name.
func VerifyArchive ΒΆ
func VerifyArchive(repository Repository, arc Archive) error
func VerifyRepo ΒΆ
func VerifyRepo(repository Repository, percentage int) (<-chan Progress, error)
func VerifySnapshot ΒΆ
func VerifySnapshot(repository Repository, snapshotId string, percentage int) (<-chan Progress, error)
func VerifyVolume ΒΆ
func VerifyVolume(repository Repository, volumeId string, percentage int) (<-chan Progress, error)
Types ΒΆ
type Archive ΒΆ
type Archive struct { Path string `json:"path"` // Where in filesystem does this belong to PointsTo string `json:"pointsto,omitempty"` // If this is a SymLink, where does it point to Mode os.FileMode `json:"mode"` // file mode bits ModTime int64 `json:"modtime"` // modification time Size uint64 `json:"size"` // size StorageSize uint64 `json:"storagesize"` // size in storage UID uint32 `json:"uid"` // owner GID uint32 `json:"gid"` // group Chunks []Chunk `json:"chunks,omitempty"` // data chunks Encrypted uint16 `json:"encrypted"` // encryption type Compressed uint16 `json:"compressed"` // compression type Type uint8 `json:"type"` // Is this a File, Directory or SymLink }
Archive contains all metadata belonging to a file/directory.
func (*Archive) ChunkForOffset ΒΆ
ChunkForOffset returns the chunk containing data beginning at offset. Returns chunk-number, offset inside this chunk, error.
type ArchiveResult ΒΆ
ArchiveResult wraps Archive and an error. Either Archive or Error is nil.
type Backend ΒΆ
type Backend interface { // Location returns the type and location of the repository Location() string // Protocols returns the Protocol Schemes supported by this backend Protocols() []string // Description returns a user-friendly description for this backend Description() string // Close the backend Close() error // AvailableSpace returns the free space in bytes on this backend AvailableSpace() (uint64, error) // LoadChunk loads a single Chunk LoadChunk(shasum string, part, totalParts uint) ([]byte, error) // StoreChunk stores a single Chunk StoreChunk(shasum string, part, totalParts uint, data []byte) (uint64, error) // DeleteChunk deletes a single Chunk DeleteChunk(shasum string, part, totalParts uint) error // LoadSnapshot loads a snapshot LoadSnapshot(id string) ([]byte, error) // SaveSnapshot stores a snapshot SaveSnapshot(id string, data []byte) error // LoadChunkIndex loads the chunk-index LoadChunkIndex() ([]byte, error) // SaveChunkIndex stores the chunk-index SaveChunkIndex(data []byte) error // InitRepository creates a new repository InitRepository() error // LoadRepository reads the metadata for a repository LoadRepository() ([]byte, error) // SaveRepository stores the metadata for a repository SaveRepository(data []byte) error }
Backend is used to store and access data.
func BackendFromURL ΒΆ
BackendFromURL returns the matching backend for path.
type BackendFactory ΒΆ
BackendFactory is used to initialize a new backend.
type BackendFilesystem ΒΆ
type BackendFilesystem interface { // Stat stats a file on disk Stat(path string) (uint64, error) // CreatePath creates a dir including all its parents dirs, when required CreatePath(path string) error // ReadFile reads a file from disk ReadFile(path string) ([]byte, error) // WriteFile writes a file to disk WriteFile(path string, data []byte) (uint64, error) // DeleteFile deletes a file from disk DeleteFile(path string) error }
BackendFilesystem is used to store and access data on a filesytem based backend.
type BackendManager ΒΆ
type BackendManager struct { Backends []*Backend // contains filtered or unexported fields }
BackendManager stores data on multiple backends.
func (*BackendManager) AddBackend ΒΆ
func (backend *BackendManager) AddBackend(be *Backend)
AddBackend adds a backend.
func (*BackendManager) DeleteChunk ΒΆ
func (backend *BackendManager) DeleteChunk(shasum string, part, totalParts uint) error
DeleteChunk deletes a single Chunk.
func (*BackendManager) InitRepository ΒΆ
func (backend *BackendManager) InitRepository() error
InitRepository creates a new repository.
func (*BackendManager) LoadChunk ΒΆ
func (backend *BackendManager) LoadChunk(chunk Chunk, part uint) ([]byte, error)
LoadChunk loads a Chunk from backends.
func (*BackendManager) LoadChunkIndex ΒΆ
func (backend *BackendManager) LoadChunkIndex() ([]byte, error)
LoadChunkIndex loads the chunk-index.
func (*BackendManager) LoadRepository ΒΆ
func (backend *BackendManager) LoadRepository() ([]byte, error)
LoadRepository reads the metadata for a repository.
func (*BackendManager) LoadSnapshot ΒΆ
func (backend *BackendManager) LoadSnapshot(id string) ([]byte, error)
LoadSnapshot loads a snapshot.
func (*BackendManager) Locations ΒΆ
func (backend *BackendManager) Locations() []string
Locations returns the urls for all backends.
func (*BackendManager) SaveChunkIndex ΒΆ
func (backend *BackendManager) SaveChunkIndex(b []byte) error
SaveChunkIndex stores the chunk-index on all storage backends.
func (*BackendManager) SaveRepository ΒΆ
func (backend *BackendManager) SaveRepository(b []byte) error
SaveRepository stores the metadata for a repository.
func (*BackendManager) SaveSnapshot ΒΆ
func (backend *BackendManager) SaveSnapshot(id string, b []byte) error
SaveSnapshot stores a snapshot on all storage backends.
func (*BackendManager) StoreChunk ΒΆ
func (backend *BackendManager) StoreChunk(chunk Chunk) (size uint64, err error)
StoreChunk stores a single Chunk on backends.
type CheckSumError ΒΆ
CheckSumError records an error and the calculated checksums that did not match.
func (*CheckSumError) Error ΒΆ
func (e *CheckSumError) Error() string
type Chunk ΒΆ
type Chunk struct { Data *[][]byte `json:"-"` DataParts uint `json:"data_parts"` ParityParts uint `json:"parity_parts"` OriginalSize int `json:"original_size"` Size int `json:"size"` DecryptedHash string `json:"decrypted_hash"` Hash string `json:"hash"` Num uint `json:"num"` }
Chunk stores an encrypted chunk alongside with its metadata.
type ChunkError ΒΆ
type ChunkError struct {
ChunkNum uint
}
ChunkError records an error and the index that caused it.
func (*ChunkError) Error ΒΆ
func (e *ChunkError) Error() string
type ChunkIndex ΒΆ
type ChunkIndex struct {
Chunks map[string]*ChunkIndexItem `json:"chunks"`
}
A ChunkIndex links chunks with snapshots.
func OpenChunkIndex ΒΆ
func OpenChunkIndex(repository *Repository) (ChunkIndex, error)
OpenChunkIndex opens an existing chunkindex.
func (*ChunkIndex) AddArchive ΒΆ
func (index *ChunkIndex) AddArchive(archive *Archive, snapshot string)
AddArchive updates chunk-index with the new chunks.
func (*ChunkIndex) Pack ΒΆ
func (index *ChunkIndex) Pack(repository *Repository) (freedSize uint64, err error)
Pack deletes unreferenced chunks and removes them from the index.
func (*ChunkIndex) RemoveSnapshot ΒΆ
func (index *ChunkIndex) RemoveSnapshot(snapshot string)
RemoveSnapshot removes all references to snapshot from the chunk-index.
func (*ChunkIndex) Save ΒΆ
func (index *ChunkIndex) Save(repository *Repository) error
Save writes a chunk-index.
type ChunkIndexItem ΒΆ
type ChunkIndexItem struct { Hash string `json:"hash"` DataParts uint `json:"data_parts"` ParityParts uint `json:"parity_parts"` Size int `json:"size"` Snapshots []string `json:"snapshots"` }
A ChunkIndexItem links a chunk with one or many snapshots.
type ChunkResult ΒΆ
ChunkResult is used to transfer either a chunk or an error down the channel.
type Compressor ΒΆ
type Compressor struct {
Method uint16
}
Compressor is a pipeline processor that compresses data.
type DataReconstructionError ΒΆ
DataReconstructionError records an error and the associated parity information.
func (*DataReconstructionError) Error ΒΆ
func (e *DataReconstructionError) Error() string
type Decompressor ΒΆ
type Decompressor struct {
Method uint16
}
Decompressor is a pipeline processor that decompresses data.
type Decryptor ΒΆ
type Decryptor struct { Method uint16 // contains filtered or unexported fields }
Decryptor is a pipeline processor that decrypts data.
func NewDecryptor ΒΆ
NewDecryptor returns a newly configured Decryptor.
type Encryptor ΒΆ
type Encryptor struct { Method uint16 // contains filtered or unexported fields }
Encryptor is a pipeline processor that encrypts data.
func NewEncryptor ΒΆ
NewEncryptor returns a newly configured Encryptor.
type Logger ΒΆ
type Logger interface { Fatal(v ...interface{}) Fatalf(format string, v ...interface{}) Warn(v ...interface{}) Warnf(format string, v ...interface{}) Print(v ...interface{}) Printf(format string, v ...interface{}) Info(v ...interface{}) Infof(format string, v ...interface{}) Debug(v ...interface{}) Debugf(format string, v ...interface{}) }
Logger is used for levelled logging and verbose flag.
type NopLogger ΒΆ
type NopLogger struct { }
The quiet NopLogger will be used by default if no logger has been set via SetLogger().
type Pipeline ΒΆ
type Pipeline struct {
Processors []PipelineProcessor
}
Pipeline passes data through various steps (for compression, encryption etc).
func NewDecodingPipeline ΒΆ
NewDecodingPipeline returns a new pipeline consisting of a decryptor and a decompressor.
func NewEncodingPipeline ΒΆ
NewEncodingPipeline returns a new pipeline consisting of a compressor and an encryptor.
func (*Pipeline) Decode ΒΆ
Decode sends the data through all configured processors and gob-decodes the result.
type PipelineProcessor ΒΆ
PipelineProcessor is a simple interface to process data.
type Progress ΒΆ
type Progress struct { Path string Timer time.Time CurrentItemStats Stats TotalStatistics Stats Error error }
Progress contains stats and current path.
func (Progress) TransferSpeed ΒΆ
TransferSpeed returns the average transfer speed in bytes per second.
type Repository ΒΆ
type Repository struct { Version uint `json:"version"` Volumes []*Volume `json:"volumes"` Paths []string `json:"storage"` Key string `json:"key"` // key for encrypting data stored with knoxite // contains filtered or unexported fields }
A Repository is a collection of backup snapshots.
func NewRepository ΒΆ
func NewRepository(path, password string) (Repository, error)
NewRepository returns a new repository.
func OpenRepository ΒΆ
func OpenRepository(path, password string) (Repository, error)
OpenRepository opens an existing repository and migrates it if possible.
func (*Repository) AddVolume ΒΆ
func (r *Repository) AddVolume(volume *Volume) error
AddVolume adds a volume to a repository.
func (*Repository) BackendManager ΒΆ
func (r *Repository) BackendManager() *BackendManager
BackendManager returns the repository's BackendManager.
func (*Repository) ChangeLocation ΒΆ
func (r *Repository) ChangeLocation(oldLocation, newLocation string) error
func (*Repository) ChangePassword ΒΆ
func (r *Repository) ChangePassword(newPassword string) error
Changes password of repository.
func (*Repository) FindSnapshot ΒΆ
func (r *Repository) FindSnapshot(id string) (*Volume, *Snapshot, error)
FindSnapshot finds a snapshot within a repository.
func (*Repository) FindVolume ΒΆ
func (r *Repository) FindVolume(id string) (*Volume, error)
FindVolume finds a volume within a repository.
func (*Repository) IsEmpty ΒΆ
func (r *Repository) IsEmpty() bool
IsEmpty returns true if there a no snapshots stored in a repository.
func (*Repository) Migrate ΒΆ
func (r *Repository) Migrate() error
Migrates a repository to the current version, if possible.
func (*Repository) RemoveVolume ΒΆ
func (r *Repository) RemoveVolume(volume *Volume) error
RemoveVolume removes a volume from a repository.
type SeekError ΒΆ
type SeekError struct {
Offset int
}
SeekError records an error and the offset that caused it.
type Snapshot ΒΆ
type Snapshot struct { ID string `json:"id"` Date time.Time `json:"date"` Description string `json:"description"` Stats Stats `json:"stats"` Archives map[string]*Archive `json:"items"` // contains filtered or unexported fields }
A Snapshot is a compilation of one or many archives.
func NewSnapshot ΒΆ
NewSnapshot creates a new snapshot.
func (*Snapshot) Add ΒΆ
func (snapshot *Snapshot) Add(repository Repository, chunkIndex *ChunkIndex, opts StoreOptions) <-chan Progress
Add adds a path to a Snapshot.
func (*Snapshot) AddArchive ΒΆ
AddArchive adds an archive to a snapshot.
func (*Snapshot) Save ΒΆ
func (snapshot *Snapshot) Save(repository *Repository) error
Save writes a snapshot's metadata.
type Stats ΒΆ
type Stats struct { Files uint64 `json:"files"` Dirs uint64 `json:"dirs"` SymLinks uint64 `json:"symlinks"` Size uint64 `json:"size"` StorageSize uint64 `json:"stored_size"` Transferred uint64 `json:"transferred"` Errors uint64 `json:"errors"` }
Stats contains a bunch of Stats counters.
func DecodeArchiveData ΒΆ
func DecodeArchiveData(repository Repository, arc Archive) ([]byte, Stats, error)
DecodeArchiveData returns the content of a single archive.
type StorageFilesystem ΒΆ
type StorageFilesystem struct { Path string // contains filtered or unexported fields }
StorageFilesystem is bridging a BackendFilesystem to a Backend interface.
func NewStorageFilesystem ΒΆ
func NewStorageFilesystem(path string, storage BackendFilesystem) (StorageFilesystem, error)
NewStorageFilesystem returns a StorageFilesystem object.
func (StorageFilesystem) DeleteChunk ΒΆ
func (backend StorageFilesystem) DeleteChunk(shasum string, part, totalParts uint) error
DeleteChunk deletes a single Chunk.
func (StorageFilesystem) InitRepository ΒΆ
func (backend StorageFilesystem) InitRepository() error
InitRepository creates a new repository.
func (StorageFilesystem) LoadChunk ΒΆ
func (backend StorageFilesystem) LoadChunk(shasum string, part, totalParts uint) ([]byte, error)
LoadChunk loads a Chunk from disk.
func (StorageFilesystem) LoadChunkIndex ΒΆ
func (backend StorageFilesystem) LoadChunkIndex() ([]byte, error)
LoadChunkIndex reads the chunk-index.
func (StorageFilesystem) LoadRepository ΒΆ
func (backend StorageFilesystem) LoadRepository() ([]byte, error)
LoadRepository reads the metadata for a repository.
func (StorageFilesystem) LoadSnapshot ΒΆ
func (backend StorageFilesystem) LoadSnapshot(id string) ([]byte, error)
LoadSnapshot loads a snapshot.
func (StorageFilesystem) SaveChunkIndex ΒΆ
func (backend StorageFilesystem) SaveChunkIndex(b []byte) error
SaveChunkIndex stores the chunk-index.
func (StorageFilesystem) SaveRepository ΒΆ
func (backend StorageFilesystem) SaveRepository(b []byte) error
SaveRepository stores the metadata for a repository.
func (StorageFilesystem) SaveSnapshot ΒΆ
func (backend StorageFilesystem) SaveSnapshot(id string, b []byte) error
SaveSnapshot stores a snapshot.
func (StorageFilesystem) StoreChunk ΒΆ
func (backend StorageFilesystem) StoreChunk(shasum string, part, totalParts uint, data []byte) (size uint64, err error)
StoreChunk stores a single Chunk on disk.
type StorageLocal ΒΆ
type StorageLocal struct {
StorageFilesystem
}
StorageLocal stores data on the local disk.
func (*StorageLocal) AvailableSpace ΒΆ
func (backend *StorageLocal) AvailableSpace() (uint64, error)
AvailableSpace returns the free space on this backend.
func (*StorageLocal) CreatePath ΒΆ
func (backend *StorageLocal) CreatePath(path string) error
CreatePath creates a dir including all its parents dirs, when required.
func (StorageLocal) DeleteFile ΒΆ
func (backend StorageLocal) DeleteFile(path string) error
DeleteFile deletes a file from disk.
func (*StorageLocal) Description ΒΆ
func (backend *StorageLocal) Description() string
Description returns a user-friendly description for this backend.
func (*StorageLocal) Location ΒΆ
func (backend *StorageLocal) Location() string
Location returns the type and location of the repository.
func (*StorageLocal) NewBackend ΒΆ
func (*StorageLocal) NewBackend(u url.URL) (Backend, error)
NewBackend returns a StorageLocal backend.
func (*StorageLocal) Protocols ΒΆ
func (backend *StorageLocal) Protocols() []string
Protocols returns the Protocol Schemes supported by this backend.
func (StorageLocal) ReadFile ΒΆ
func (backend StorageLocal) ReadFile(path string) ([]byte, error)
ReadFile reads a file from disk.
type StoreOptions ΒΆ
type StoreOptions struct { CWD string Paths []string Excludes []string Compress uint16 Encrypt uint16 Pedantic bool DataParts uint ParityParts uint }
StoreOptions holds all the storage settings for a snapshot operation.
type Volume ΒΆ
type Volume struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Snapshots []string `json:"snapshots"` }
A Volume contains various snapshots.
func (*Volume) AddSnapshot ΒΆ
AddSnapshot adds a snapshot to a volume.
func (*Volume) LoadSnapshot ΒΆ
func (v *Volume) LoadSnapshot(id string, repository *Repository) (*Snapshot, error)
LoadSnapshot loads a snapshot within a volume from a repository.
func (*Volume) RemoveSnapshot ΒΆ
RemoveSnapshot removes a snapshot from a volume.
Source Files ΒΆ
- archive.go
- backend.go
- backendmanager.go
- chunk.go
- chunkindex.go
- compression.go
- decode.go
- encryption.go
- hash.go
- logger.go
- loglevel.go
- pipeline.go
- progress.go
- redundancy.go
- repository.go
- scanner.go
- snapshot.go
- stat_generic.go
- stat_unix.go
- statistics.go
- storage_filesystem.go
- storage_local.go
- storage_local_unix.go
- verify.go
- volume.go
Directories ΒΆ
Path | Synopsis |
---|---|
cmd
|
|
knoxite
* knoxite * Copyright (c) 2020, Nicolas Martin <penguwin@penguwin.eu> * * For license see LICENSE
|
* knoxite * Copyright (c) 2020, Nicolas Martin <penguwin@penguwin.eu> * * For license see LICENSE |
knoxite/config
* knoxite * Copyright (c) 2020, Nicolas Martin <penguwin@penguwin.eu> * 2020, Sergio Rubio <sergio@rubio.im> * * For license see LICENSE
|
* knoxite * Copyright (c) 2020, Nicolas Martin <penguwin@penguwin.eu> * 2020, Sergio Rubio <sergio@rubio.im> * * For license see LICENSE |