fsx

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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