github.com/caddyserver/caddy/v2/internal/filesystems
No package summary is available.
Package
Files: 2. Third party imports: 0. Imports from organisation: 0. Tests: 0. Benchmarks: 0.
Constants
Vars
Types
FileSystemMap
FileSystemMap stores a map of filesystems the empty key will be overwritten to be the default key it includes a default filesystem, based off the os fs
| Field name | Field type | Comment |
|---|---|---|
| m |
|
No comment on field. |
OsFS
OsFS is a simple fs.FS implementation that uses the local file system. (We do not use os.DirFS because we do our own rooting or path prefixing without being constrained to a single root folder. The standard os.DirFS implementation is problematic since roots can be dynamic in our application.)
OsFS also implements fs.StatFS, fs.GlobFS, fs.ReadDirFS, and fs.ReadFileFS.
wrapperFs
wrapperFs exists so can easily add to wrapperFs down the line
| Field name | Field type | Comment |
|---|---|---|
| key |
|
No comment on field. |
|
No comment on field. |
Functions
func (*FileSystemMap) Default
Default will get the default filesystem in the filesystem map
func (*FileSystemMap) Get
Get will get a filesystem with a given key
Uses: fs.FS, strings.TrimSpace.func (*FileSystemMap) Register
Register will add the filesystem with key to later be retrieved A call with a nil fs will call unregister, ensuring that a call to Default() will never be nil
func (*FileSystemMap) Unregister
Unregister will remove the filesystem with key from the filesystem map if the key is the default key, it will set the default to the osFS instead of deleting it modules should call this on cleanup to be safe
func (OsFS) Glob
func (OsFS) Open
func (OsFS) ReadDir
func (OsFS) ReadFile
func (OsFS) Stat
Private functions
func key
note that the first invocation of key cannot be called in a racy context.