Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystem ¶
type FileSystem struct { Root fs.FS Logger *log.Logger Verbosity LogVerbosity // contains filtered or unexported fields }
FileSystem represents a chrooted filesystem.
func New ¶
func New(dirpath string) FileSystem
New generates a new FileSystem rooted at dirpath in the operating system.
func (*FileSystem) CreateDirectory ¶
func (fsys *FileSystem) CreateDirectory(dirpath string)
CreateDirectory creates a directory rooted within fsys. If dirpath already exists within fsys, then it succeeds quietly. Will automatically create intermediary directories.
func (*FileSystem) CreateFile ¶
func (fsys *FileSystem) CreateFile(filepath string, data []byte) *os.File
CreateFile creates a file rooted from fsys at path filepath and fills it with the given data.
type LogVerbosity ¶
type LogVerbosity int // Could extract all of this out to separate logging utility, or use another pre-built one
const ( DEFAULT LogVerbosity = iota INFO DEBUG )
Click to show internal directories.
Click to hide internal directories.