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 MemoryFileInfo
- type MemoryFileSystem
- func (mfs *MemoryFileSystem) GetFS() fs.FS
- func (mfs *MemoryFileSystem) IsReadOnly() bool
- func (mfs *MemoryFileSystem) ReadFile(name string) ([]byte, error)
- func (mfs *MemoryFileSystem) Stat(name string) (fs.FileInfo, error)
- func (mfs *MemoryFileSystem) Sub(dir string) (FileSystem, error)
- func (mfs *MemoryFileSystem) WalkDir(root string, fn fs.WalkDirFunc) error
- func (mfs *MemoryFileSystem) WriteFile(name string, data []byte) error
- 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 MemoryFileInfo ¶ added in v0.2.0
type MemoryFileInfo struct {
// contains filtered or unexported fields
}
MemoryFileInfo implements fs.FileInfo for memory files
func (*MemoryFileInfo) IsDir ¶ added in v0.2.0
func (m *MemoryFileInfo) IsDir() bool
func (*MemoryFileInfo) ModTime ¶ added in v0.2.0
func (m *MemoryFileInfo) ModTime() time.Time
func (*MemoryFileInfo) Mode ¶ added in v0.2.0
func (m *MemoryFileInfo) Mode() fs.FileMode
func (*MemoryFileInfo) Name ¶ added in v0.2.0
func (m *MemoryFileInfo) Name() string
func (*MemoryFileInfo) Size ¶ added in v0.2.0
func (m *MemoryFileInfo) Size() int64
func (*MemoryFileInfo) Sys ¶ added in v0.2.0
func (m *MemoryFileInfo) Sys() any
type MemoryFileSystem ¶ added in v0.2.0
type MemoryFileSystem struct {
// contains filtered or unexported fields
}
MemoryFileSystem in-memory file system for testing
func NewMemoryFileSystem ¶ added in v0.2.0
func NewMemoryFileSystem() *MemoryFileSystem
NewMemoryFileSystem creates a new in-memory file system
func (*MemoryFileSystem) GetFS ¶ added in v0.2.0
func (mfs *MemoryFileSystem) GetFS() fs.FS
func (*MemoryFileSystem) IsReadOnly ¶ added in v0.2.0
func (mfs *MemoryFileSystem) IsReadOnly() bool
func (*MemoryFileSystem) ReadFile ¶ added in v0.2.0
func (mfs *MemoryFileSystem) ReadFile(name string) ([]byte, error)
func (*MemoryFileSystem) Stat ¶ added in v0.2.0
func (mfs *MemoryFileSystem) Stat(name string) (fs.FileInfo, error)
func (*MemoryFileSystem) Sub ¶ added in v0.2.0
func (mfs *MemoryFileSystem) Sub(dir string) (FileSystem, error)
func (*MemoryFileSystem) WalkDir ¶ added in v0.2.0
func (mfs *MemoryFileSystem) WalkDir(root string, fn fs.WalkDirFunc) error
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.