Documentation ¶
Index ¶
- type OS
- type RealOS
- func (RealOS) CopyFile(src, dest string, perm os.FileMode) error
- func (RealOS) DeviceUUID(device string) (string, error)
- func (RealOS) GetMounts() ([]*mount.Info, error)
- func (RealOS) LookupMount(path string) (containerdmount.Info, error)
- func (RealOS) MkdirAll(path string, perm os.FileMode) error
- func (RealOS) Mount(source string, target string, fstype string, flags uintptr, data string) error
- func (RealOS) OpenFifo(ctx context.Context, fn string, flag int, perm os.FileMode) (io.ReadWriteCloser, error)
- func (RealOS) RemoveAll(path string) error
- func (RealOS) ResolveSymbolicLink(path string) (string, error)
- func (RealOS) Stat(name string) (os.FileInfo, error)
- func (RealOS) Unmount(target string, flags int) error
- func (RealOS) WriteFile(filename string, data []byte, perm os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OS ¶
type OS interface { MkdirAll(path string, perm os.FileMode) error RemoveAll(path string) error OpenFifo(ctx context.Context, fn string, flag int, perm os.FileMode) (io.ReadWriteCloser, error) Stat(name string) (os.FileInfo, error) ResolveSymbolicLink(name string) (string, error) CopyFile(src, dest string, perm os.FileMode) error WriteFile(filename string, data []byte, perm os.FileMode) error Mount(source string, target string, fstype string, flags uintptr, data string) error Unmount(target string, flags int) error GetMounts() ([]*mount.Info, error) LookupMount(path string) (containerdmount.Info, error) DeviceUUID(device string) (string, error) }
OS collects system level operations that need to be mocked out during tests.
type RealOS ¶
type RealOS struct{}
RealOS is used to dispatch the real system level operations.
func (RealOS) DeviceUUID ¶
DeviceUUID gets device uuid of a device. The passed in device should be an absolute path of the device.
func (RealOS) LookupMount ¶ added in v1.0.0
func (RealOS) LookupMount(path string) (containerdmount.Info, error)
LookupMount gets mount info of a given path.
func (RealOS) OpenFifo ¶
func (RealOS) OpenFifo(ctx context.Context, fn string, flag int, perm os.FileMode) (io.ReadWriteCloser, error)
OpenFifo will call fifo.OpenFifo to open a fifo.
func (RealOS) ResolveSymbolicLink ¶ added in v1.0.0
ResolveSymbolicLink will follow any symbolic links
Click to show internal directories.
Click to hide internal directories.