Documentation
¶
Overview ¶
Package volume is named volumes: trees that outlive the containers that mount them (run -v NAME:/path[:ro]), kept in the state store like containers are. A volume is a writable rootfs.FS with a quota; it is mounted into a container as a WASI preopen (runtime.Mount), so two containers mounting one volume share one tree.
Index ¶
- Variables
- func DecodeRecord(b []byte) (*record, error)
- func ValidName(name string) bool
- type Manager
- func (m *Manager) Close(ctx context.Context) error
- func (m *Manager) Create(name string, labels map[string]string) (*Volume, bool, error)
- func (m *Manager) Flush(ctx context.Context) error
- func (m *Manager) Get(name string) (*Volume, error)
- func (m *Manager) List() []*Volume
- func (m *Manager) PersistError() error
- func (m *Manager) Prune(all bool, inUse func(string) []string) ([]string, int64)
- func (m *Manager) Remove(name string, inUse func(string) []string) error
- func (m *Manager) Restore(lim rootfs.Limits) ([]string, error)
- type Options
- type Volume
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("no such volume") ErrInUse = errors.New("volume is in use") ErrInvalid = errors.New("invalid volume") ErrTooMany = errors.New("too many volumes") )
Errors the API maps to statuses.
Functions ¶
func DecodeRecord ¶
DecodeRecord reads a stored volume record (exported for the fuzzer).
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager owns every volume.
func (*Manager) Create ¶
Create makes a volume, or returns the existing one of that name (Docker's create is idempotent). An empty name makes an anonymous one.
func (*Manager) PersistError ¶
PersistError is the last failure to store a volume.
type Options ¶
type Options struct {
// Store keeps volumes across restarts (nil: memory only).
Store state.Store
// Quota bounds one volume (default 64 MiB, 16384 entries).
Quota rootfs.Quota
// Max bounds how many volumes exist (default 64).
Max int
// SaveEvery is how often changed volumes are stored (default 2s).
SaveEvery time.Duration
}
Options configure a Manager.
Click to show internal directories.
Click to hide internal directories.