fsh

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDirPerm = 0o755

Variables

This section is empty.

Functions

func IsExists

func IsExists(fSys FS, path string) bool

func ReadJson

func ReadJson[T any](fs FS, path string) (*T, error)

func ReadOrCreateJson

func ReadOrCreateJson[T any](fs FS, path string, defaultVal T) (*T, error)

func WriteJson

func WriteJson(fs FS, in any, path string) error

Types

type FS

type FS interface {
	afero.Fs
	afero.Linker
}

func NewRealFS

func NewRealFS() FS

type MemFS

type MemFS struct {
	afero.Fs
}

func NewMemFS

func NewMemFS(files map[string]string) *MemFS

func (*MemFS) GetTree

func (m *MemFS) GetTree(dir string) ([]string, error)

func (*MemFS) SymlinkIfPossible

func (m *MemFS) SymlinkIfPossible(oldname, newname string) error

Jump to

Keyboard shortcuts

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