filesystem

package
v0.0.0-...-19bcc65 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: AGPL-3.0 Imports: 13 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReservedHostnames = []string{
	"COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",
	"LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9",
	"PRN", "AUX", "NUL",
}

Functions

func BytesToMap

func BytesToMap(data []byte) (map[string]interface{}, error)

func Combine

func Combine(path1 string, path2 ...string) string

func Copy

func Copy(a, b string, opts ...copy.Options) error

func CopyAndRename

func CopyAndRename(files []string, oldPath, newPath, oldName, newName string) error

func DeleteDirectory

func DeleteDirectory(fileName string) error

func DeleteEmptyDirectories

func DeleteEmptyDirectories(root string) error

func Exists

func Exists(fileName string) bool

func FilenameToBytes

func FilenameToBytes(initial, filename string) ([]byte, error)

func FilenameToMap

func FilenameToMap(initial, filename string) (map[string]interface{}, error)

func FromCwd

func FromCwd(path1 ...string) (string, error)

func GetDirectories

func GetDirectories(filePath string) []string

func GetDirectoryName

func GetDirectoryName(fileName string) string

func GetFileExtension

func GetFileExtension(fileName string) string

func GetFileName

func GetFileName(fileName string) string

func GetFiles

func GetFiles(filePath string) []string

func GetRelativePath

func GetRelativePath(directories ...string) string

func IsEmpty

func IsEmpty(dir string) (bool, error)

func IsValidHostname

func IsValidHostname(hostname string) bool

func OverwriteFile

func OverwriteFile(file *os.File) error

func ReadAllLines

func ReadAllLines(file *os.File) ([]string, error)

func ReadAllStringLines

func ReadAllStringLines(input string) ([]string, error)

func ReadFile

func ReadFile(fileName string) ([]byte, error)

func Scan

func Scan(scanner *bufio.Scanner) ([]string, error)

func SortFileNames

func SortFileNames(files []string) []string

func TrimPath

func TrimPath(input string) string

func WriteFile

func WriteFile(fileName string, data []byte, perm fs.FileMode) error

func WriteToFile

func WriteToFile(file *os.File, entries []string) error

Types

type EmbeddedFileSystem

type EmbeddedFileSystem struct {
	Initial string
	FS      embed.FS
}

func (EmbeddedFileSystem) BytesToMap

func (e EmbeddedFileSystem) BytesToMap(data []byte) (map[string]interface{}, error)

func (EmbeddedFileSystem) FilenameToBytes

func (e EmbeddedFileSystem) FilenameToBytes(filename string) ([]byte, error)

func (EmbeddedFileSystem) FilenameToMap

func (e EmbeddedFileSystem) FilenameToMap(filename string) (map[string]interface{}, error)

Jump to

Keyboard shortcuts

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