fs

package
v0.0.0-...-cf0341d Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FilepathSeparator = string(filepath.Separator)

Functions

This section is empty.

Types

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

	Path() *paths.Path
	SetPath(path *paths.Path)
}

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