fs

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 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

View Source
var FilepathSeparator = string(filepath.Separator)

Functions

This section is empty.

Types

type ComponentPath

type ComponentPath interface {
	GetComponent() string
	GetPath() string
	GetLang() string
}

type Dir

type Dir interface {
	WorkingDir() string
	PublishDir() string
	ResourceDir() string

	MediaTypes() media.Types
}

type FileMeta

type FileMeta interface {
	Open() (afero.File, error)

	FileName() string
	RelativeFilename() (string, error)
	Component() string
	Root() string
}

type FileMetaInfo

type FileMetaInfo interface {
	fs.FileInfo
	FileMeta
}

type FilesystemUnwrapper

type FilesystemUnwrapper interface {
	UnwrapFilesystem() afero.Fs
}

FilesystemUnwrapper returns the underlying filesystem.

type FilesystemsUnwrapper

type FilesystemsUnwrapper interface {
	UnwrapFilesystems() []afero.Fs
}

FilesystemsUnwrapper returns the underlying filesystems.

type Fs

type Fs interface {
	OriginFs
	PathFs
}

type OriginFs

type OriginFs interface {
	// Origin is Hugo's source file system.
	// Note that this will always be a "plain" Afero filesystem:
	// * afero.OsFs when running in production
	// * afero.MemMapFs for many of the tests.
	Origin() afero.Fs

	// Publish is where Hugo publishes its rendered content.
	// It's mounted inside publishDir (default /public).
	Publish() afero.Fs

	// Working is a read-only file system
	// restricted to the project working dir.
	Working() afero.Fs
}

OriginFs holds the core filesystems used by Hugo.

type PathFs

type PathFs interface {
	LayoutFs() afero.Fs
	ContentFs() afero.Fs
}

type WalkCallback

type WalkCallback struct {
	// Will be called in order.
	HookPre  WalkHook // Optional.
	WalkFn   WalkFunc
	HookPost WalkHook // Optional.
}

type WalkFunc

type WalkFunc func(path string, info FileMetaInfo) error

type WalkHook

type WalkHook func(dir FileMetaInfo, path string, readdir []FileMetaInfo) ([]FileMetaInfo, error)

type WalkwayConfig

type WalkwayConfig struct {
	// One or both of these may be pre-set.
	Info       FileMetaInfo               // The start info.
	DirEntries []FileMetaInfo             // The start info's dir entries.
	IgnoreFile func(filename string) bool // Optional

	// Some optional flags.
	FailOnNotExist bool // If set, return an error if a directory is not found.
	SortDirEntries bool // If set, sort the dir entries by Name before calling the WalkFn, default is ReaDir order.
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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