filesystem

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS interface {
	ReadFile(path string) ([]byte, error)
	WriteFile(path string, data []byte, perm os.FileMode) error
	Exists(path string) (bool, error)
	MkdirAll(path string, perm os.FileMode) error
	Remove(path string) error
	RemoveAll(path string) error
}

type Local

type Local struct{}

func NewLocal

func NewLocal() *Local

func (*Local) Exists

func (f *Local) Exists(path string) (bool, error)

func (*Local) IsMounted

func (f *Local) IsMounted(target string) (bool, error)

func (*Local) MkdirAll

func (f *Local) MkdirAll(path string, perm os.FileMode) error

func (*Local) Mount

func (f *Local) Mount(device, target string, readonly bool) error

func (*Local) ReadFile

func (f *Local) ReadFile(path string) ([]byte, error)

func (*Local) Remove

func (f *Local) Remove(path string) error

func (*Local) RemoveAll

func (f *Local) RemoveAll(path string) error

func (*Local) Unmount

func (f *Local) Unmount(target string) error

func (*Local) WriteFile

func (f *Local) WriteFile(path string, data []byte, perm os.FileMode) error

type Mock

type Mock struct {
	// contains filtered or unexported fields
}

func NewMock

func NewMock() *Mock

func (*Mock) Exists

func (f *Mock) Exists(path string) (bool, error)

func (*Mock) GetFile

func (f *Mock) GetFile(path string) ([]byte, bool)

func (*Mock) IsMounted

func (f *Mock) IsMounted(target string) (bool, error)

func (*Mock) MkdirAll

func (f *Mock) MkdirAll(path string, perm os.FileMode) error

func (*Mock) Mount

func (f *Mock) Mount(device, target string, readonly bool) error

func (*Mock) ReadFile

func (f *Mock) ReadFile(path string) ([]byte, error)

func (*Mock) Remove

func (f *Mock) Remove(path string) error

func (*Mock) RemoveAll

func (f *Mock) RemoveAll(path string) error

func (*Mock) Removed

func (f *Mock) Removed() []string

func (*Mock) SetFile

func (f *Mock) SetFile(path string, content []byte)

func (*Mock) SetFileString

func (f *Mock) SetFileString(path, content string)

func (*Mock) SimulateMountedPartition

func (f *Mock) SimulateMountedPartition(partNum int, version string)

func (*Mock) Unmount

func (f *Mock) Unmount(target string) error

func (*Mock) WriteFile

func (f *Mock) WriteFile(path string, data []byte, perm os.FileMode) error

type MountableFS

type MountableFS interface {
	FS
	Mount(device, target string, readonly bool) error
	Unmount(target string) error
	IsMounted(target string) (bool, error)
}

type SSH

type SSH struct {
	// contains filtered or unexported fields
}

func NewSSH

func NewSSH(client *ssh.Client) (*SSH, error)

func (*SSH) Close

func (f *SSH) Close() error

func (*SSH) Exists

func (f *SSH) Exists(path string) (bool, error)

func (*SSH) IsMounted

func (f *SSH) IsMounted(target string) (bool, error)

func (*SSH) MkdirAll

func (f *SSH) MkdirAll(path string, perm os.FileMode) error

func (*SSH) Mount

func (f *SSH) Mount(device, target string, readonly bool) error

func (*SSH) ReadFile

func (f *SSH) ReadFile(path string) ([]byte, error)

func (*SSH) Remove

func (f *SSH) Remove(path string) error

func (*SSH) RemoveAll

func (f *SSH) RemoveAll(path string) error

func (*SSH) Unmount

func (f *SSH) Unmount(target string) error

func (*SSH) WriteFile

func (f *SSH) WriteFile(path string, data []byte, perm os.FileMode) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL