fsx

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseFS

type BaseFS struct {
	afero.Fs
}

BaseFS is our default implementation of the FS interface.

func FromAfero

func FromAfero(fSys afero.Fs) *BaseFS

FromAfero returns a new BaseFS instance from an afero.Fs.

func FromIOFS

func FromIOFS(fSys fs.FS) *BaseFS

FromIOFS returns a new BaseFS instance from an io/fs.FS.

func NewBasePathFs

func NewBasePathFs(fSys FS, basePath string) *BaseFS

NewBasePathFs returns a new BaseFS which wraps the given filesystem with a base path.

func NewMemMapFs

func NewMemMapFs() *BaseFS

NewMemMapFs returns a new BaseFS which wraps the memory filesystem.

func NewOsFs

func NewOsFs() *BaseFS

NewOsFs returns a new BaseFS which wraps the OS filesystem.

func NewReadOnlyFs

func NewReadOnlyFs(FfSys FS) *BaseFS

NewReadOnlyFs returns a new BaseFS which wraps the given filesystem with a read-only filesystem.

func (*BaseFS) IOFS

func (b *BaseFS) IOFS() fs.FS

IOFS returns the filesystem as an io/fs.FS.

type FS

type FS interface {
	afero.Fs
	IOFS() fs.FS
}

FS is our default interface for filesystems.

type FallbackFS

type FallbackFS struct {
	FS
	// contains filtered or unexported fields
}

FallbackFS is a filesystem that layers a primary filesystem on top of a secondary filesystem.

func NewFallbackFS

func NewFallbackFS(primary, secondary FS) *FallbackFS

NewFallbackFS returns a new FallbackFS instance.

func (*FallbackFS) Primary

func (d *FallbackFS) Primary() *BaseFS

Primary returns the primary filesystem.

func (*FallbackFS) Secondary

func (d *FallbackFS) Secondary() *BaseFS

Secondary returns the secondary filesystem.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳