Documentation
¶
Index ¶
- type EmbedFileSystem
- func (efs *EmbedFileSystem) GetFS() fs.FS
- func (efs *EmbedFileSystem) IsReadOnly() bool
- func (efs *EmbedFileSystem) ReadFile(name string) ([]byte, error)
- func (efs *EmbedFileSystem) Stat(name string) (fs.FileInfo, error)
- func (efs *EmbedFileSystem) Sub(dir string) (FileSystem, error)
- func (efs *EmbedFileSystem) WalkDir(root string, fn fs.WalkDirFunc) error
- type FileSystem
- type OSFileSystem
- func (osfs *OSFileSystem) GetFS() fs.FS
- func (osfs *OSFileSystem) IsReadOnly() bool
- func (osfs *OSFileSystem) ReadFile(name string) ([]byte, error)
- func (osfs *OSFileSystem) Stat(name string) (fs.FileInfo, error)
- func (osfs *OSFileSystem) Sub(dir string) (FileSystem, error)
- func (osfs *OSFileSystem) WalkDir(root string, fn fs.WalkDirFunc) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmbedFileSystem ¶
type EmbedFileSystem struct {
// contains filtered or unexported fields
}
EmbedFileSystem file system based on embed.FS
func NewEmbedFileSystem ¶
func NewEmbedFileSystem(embedFS fs.FS) *EmbedFileSystem
NewEmbedFileSystem creates a file system based on embed.FS
func (*EmbedFileSystem) GetFS ¶
func (efs *EmbedFileSystem) GetFS() fs.FS
func (*EmbedFileSystem) IsReadOnly ¶
func (efs *EmbedFileSystem) IsReadOnly() bool
func (*EmbedFileSystem) ReadFile ¶
func (efs *EmbedFileSystem) ReadFile(name string) ([]byte, error)
func (*EmbedFileSystem) Sub ¶
func (efs *EmbedFileSystem) Sub(dir string) (FileSystem, error)
func (*EmbedFileSystem) WalkDir ¶
func (efs *EmbedFileSystem) WalkDir(root string, fn fs.WalkDirFunc) error
type FileSystem ¶
type FileSystem interface {
ReadFile(name string) ([]byte, error)
Stat(name string) (fs.FileInfo, error)
WalkDir(root string, fn fs.WalkDirFunc) error
Sub(dir string) (FileSystem, error)
// GetFS returns the underlying fs.FS interface for integration with standard library
GetFS() fs.FS
// IsReadOnly returns whether the file system is read-only
IsReadOnly() bool
}
FileSystem unified file system interface
type OSFileSystem ¶
type OSFileSystem struct {
// contains filtered or unexported fields
}
OSFileSystem operating system-based file system
func NewOSFileSystem ¶
func NewOSFileSystem(root string) *OSFileSystem
NewOSFileSystem creates an operating system-based file system
func (*OSFileSystem) GetFS ¶
func (osfs *OSFileSystem) GetFS() fs.FS
func (*OSFileSystem) IsReadOnly ¶
func (osfs *OSFileSystem) IsReadOnly() bool
func (*OSFileSystem) Sub ¶
func (osfs *OSFileSystem) Sub(dir string) (FileSystem, error)
func (*OSFileSystem) WalkDir ¶
func (osfs *OSFileSystem) WalkDir(root string, fn fs.WalkDirFunc) error
Click to show internal directories.
Click to hide internal directories.