filesystem

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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) Stat

func (efs *EmbedFileSystem) Stat(name string) (fs.FileInfo, 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) ReadFile

func (osfs *OSFileSystem) ReadFile(name string) ([]byte, error)

func (*OSFileSystem) Stat

func (osfs *OSFileSystem) Stat(name string) (fs.FileInfo, error)

func (*OSFileSystem) Sub

func (osfs *OSFileSystem) Sub(dir string) (FileSystem, error)

func (*OSFileSystem) WalkDir

func (osfs *OSFileSystem) WalkDir(root string, fn fs.WalkDirFunc) error

Jump to

Keyboard shortcuts

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