Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FullIdWithSnapshot ¶
I'm bored of writing "if snapshotId is empty"
func LogZFSCommand ¶
func LogZFSCommand(filesystemId, command string)
TODO: why not use a logger and using a file with it then tune the level? This is used aalllll over the codebase.
Types ¶
type DiffResult ¶
type DiffResult struct {
// contains filtered or unexported fields
}
type DiffSide ¶
type DiffSide map[string]DiffResult
type FilesystemDiffCache ¶
type FilesystemResultCache ¶
type FilesystemResultCache struct { SnapshotID string Result []types.ZFSFileDiff }
type ZFS ¶
type ZFS interface { GetPoolID() string GetZPoolCapacity() (float64, error) ReportZpoolCapacity() error FindFilesystemIdsOnSystem() []string DeleteFilesystemInZFS(fs string) error // Return: // 1. How many bytes changed since the given filesystem snapshot. // 2. The total number of bytes used by the filesystem. Specifically the // "referenced" attribute, which means if two filesystems share some data, // it'll be double-counted. Which is fine, probably, ZFS being smart is an // implementation detail. GetDirtyDelta(filesystemId, latestSnap string) (dirtyBytes int64, usedBytes int64, err error) Snapshot(filesystemId, snapshotId string, meta []string) ([]byte, error) List(filesystemId, snapshotId string) ([]byte, error) FQ(filesystemId string) string DiscoverSystem(fs string) (*types.Filesystem, error) StashBranch(existingFs string, newFs string, rollbackTo string) error PredictSize(fromFilesystemId, fromSnapshotId, toFilesystemId, toSnapshotId string) (int64, error) Clone(filesystemId, originSnapshotId, newCloneFilesystemId string) ([]byte, error) Rollback(filesystemId, snapshotId string) ([]byte, error) Create(filesystemId string) ([]byte, error) Recv(pipeReader *io.PipeReader, toFilesystemId string, errBuffer *bytes.Buffer) error ApplyPrelude(prelude types.Prelude, fs string) error Send(fromFilesystemId, fromSnapshotId, toFilesystemId, toSnapshotId string, preludeEncoded []byte) (*io.PipeReader, chan error) SetCanmount(filesystemId, snapshotId string) ([]byte, error) Mount(filesystemId, snapshotId string, options string, mountPath string) ([]byte, error) Fork(filesystemId, latestSnapshot, forkFilesystemId string) error Diff(filesystemId string) ([]types.ZFSFileDiff, error) // LastModified returns last modified temp snapshot, must be called after Diff LastModified(filesystemID string) (*types.LastModified, error) DestroyTmpSnapIfExists(filesystemId string) error }
Click to show internal directories.
Click to hide internal directories.