Versions in this module Expand all Collapse all v1 v1.3.4 Apr 16, 2020 v1.0.0 May 17, 2020 Changes in this version + var ErrAlreadyExists = errors.New("object already exists") — linux/amd64 + var ErrNotFound = errors.New("not found") — linux/amd64 + type Config struct — linux/amd64 + AsyncRemove bool + BaseImageSize string + BaseImageSizeBytes uint64 + PoolName string + RootPath string + func LoadConfig(path string) (*Config, error) + func (c *Config) Validate() error + type DeviceInfo struct — linux/amd64 + DeviceID uint32 + Error string + Name string + ParentName string + Size uint64 + State DeviceState + type DeviceInfoCallback func(deviceInfo *DeviceInfo) error — linux/amd64 + type DeviceState int — linux/amd64 + const Activated + const Activating + const Created + const Creating + const Deactivated + const Deactivating + const Faulty + const Removed + const Removing + const Resumed + const Resuming + const Suspended + const Suspending + const Unknown + func (s DeviceState) String() string + type PoolDevice struct — linux/amd64 + func NewPoolDevice(ctx context.Context, config *Config) (*PoolDevice, error) + func (p *PoolDevice) Close() error + func (p *PoolDevice) CreateSnapshotDevice(ctx context.Context, deviceName string, snapshotName string, ...) (retErr error) + func (p *PoolDevice) CreateThinDevice(ctx context.Context, deviceName string, virtualSizeBytes uint64) (retErr error) + func (p *PoolDevice) DeactivateDevice(ctx context.Context, deviceName string, deferred, withForce bool) error + func (p *PoolDevice) GetUsage(deviceName string) (int64, error) + func (p *PoolDevice) IsActivated(deviceName string) bool + func (p *PoolDevice) IsLoaded(deviceName string) bool + func (p *PoolDevice) MarkDeviceState(ctx context.Context, name string, state DeviceState) error + func (p *PoolDevice) RemoveDevice(ctx context.Context, deviceName string) error + func (p *PoolDevice) RemovePool(ctx context.Context) error + func (p *PoolDevice) ResumeDevice(ctx context.Context, deviceName string) error + func (p *PoolDevice) SuspendDevice(ctx context.Context, deviceName string) error + func (p *PoolDevice) WalkDevices(ctx context.Context, cb func(info *DeviceInfo) error) error + type PoolMetadata struct — linux/amd64 + func NewPoolMetadata(dbfile string) (*PoolMetadata, error) + func (m *PoolMetadata) AddDevice(ctx context.Context, info *DeviceInfo) error + func (m *PoolMetadata) ChangeDeviceState(ctx context.Context, name string, state DeviceState) error + func (m *PoolMetadata) Close() error + func (m *PoolMetadata) GetDevice(ctx context.Context, name string) (*DeviceInfo, error) + func (m *PoolMetadata) GetDeviceNames(ctx context.Context) ([]string, error) + func (m *PoolMetadata) MarkFaulty(ctx context.Context, name string) error + func (m *PoolMetadata) RemoveDevice(ctx context.Context, name string) error + func (m *PoolMetadata) UpdateDevice(ctx context.Context, name string, fn DeviceInfoCallback) error + func (m *PoolMetadata) WalkDevices(ctx context.Context, cb func(info *DeviceInfo) error) error + type Snapshotter struct — linux/amd64 + func NewSnapshotter(ctx context.Context, config *Config) (*Snapshotter, error) + func (s *Snapshotter) Cleanup(ctx context.Context) error + func (s *Snapshotter) Close() error + func (s *Snapshotter) Commit(ctx context.Context, name, key string, opts ...snapshots.Opt) error + func (s *Snapshotter) Mounts(ctx context.Context, key string) ([]mount.Mount, error) + func (s *Snapshotter) Prepare(ctx context.Context, key, parent string, opts ...snapshots.Opt) ([]mount.Mount, error) + func (s *Snapshotter) Remove(ctx context.Context, key string) error + func (s *Snapshotter) ResetPool(ctx context.Context) error + func (s *Snapshotter) Stat(ctx context.Context, key string) (snapshots.Info, error) + func (s *Snapshotter) Update(ctx context.Context, info snapshots.Info, fieldpaths ...string) (snapshots.Info, error) + func (s *Snapshotter) Usage(ctx context.Context, key string) (snapshots.Usage, error) + func (s *Snapshotter) View(ctx context.Context, key, parent string, opts ...snapshots.Opt) ([]mount.Mount, error) + func (s *Snapshotter) Walk(ctx context.Context, fn snapshots.WalkFunc, fs ...string) error