fs

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 6 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
}

func NewEmbedFileSystem

func NewEmbedFileSystem(fs embed.FS) *EmbedFileSystem

func (*EmbedFileSystem) FileExists

func (fs *EmbedFileSystem) FileExists(path string) bool

func (*EmbedFileSystem) MkdirAll

func (fs *EmbedFileSystem) MkdirAll(path string, perm iofs.FileMode) error

func (*EmbedFileSystem) ReadDir

func (fs *EmbedFileSystem) ReadDir(path string) ([]iofs.DirEntry, error)

func (*EmbedFileSystem) ReadFile

func (fs *EmbedFileSystem) ReadFile(path string) ([]byte, error)

func (*EmbedFileSystem) Remove

func (fs *EmbedFileSystem) Remove(path string) error

func (*EmbedFileSystem) WriteFile

func (fs *EmbedFileSystem) WriteFile(path string, data []byte, perm iofs.FileMode) error

type FileSystem

type FileSystem interface {
	ReadFile(path string) ([]byte, error)
	ReadDir(path string) ([]iofs.DirEntry, error)
	FileExists(path string) bool
	WriteFile(path string, data []byte, perm iofs.FileMode) error
	MkdirAll(path string, perm iofs.FileMode) error
	Remove(path string) error
}

type OSFileSystem

type OSFileSystem struct{}

func NewOSFileSystem

func NewOSFileSystem() *OSFileSystem

func (*OSFileSystem) CopyFile

func (fs *OSFileSystem) CopyFile(src, dst string) error

func (*OSFileSystem) FileExists

func (fs *OSFileSystem) FileExists(path string) bool

func (*OSFileSystem) MkdirAll

func (fs *OSFileSystem) MkdirAll(path string, perm iofs.FileMode) error

func (*OSFileSystem) ReadDir

func (fs *OSFileSystem) ReadDir(path string) ([]iofs.DirEntry, error)

func (*OSFileSystem) ReadFile

func (fs *OSFileSystem) ReadFile(path string) ([]byte, error)

func (*OSFileSystem) Remove

func (fs *OSFileSystem) Remove(path string) error

func (*OSFileSystem) WalkDir

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

func (*OSFileSystem) WriteFile

func (fs *OSFileSystem) WriteFile(path string, data []byte, perm iofs.FileMode) error

Jump to

Keyboard shortcuts

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