Documentation ¶
Overview ¶
Package fsimpl contains read-only fs.FS implementations for various different local and remote back-ends, along with a lookup function that allows for mapping URL schemes to matching filesystems.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentType ¶
ContentType returns the MIME content type for the given io/fs.FileInfo. If fi has a ContentType method, it will be used first, otherwise the filename's extension will be used. See the docs for mime.TypeByExtension for details on how extension lookup works.
The returned value may have parameters (e.g. "application/json; charset=utf-8") which can be parsed with mime.ParseMediaType.
func WithContextFS ¶
WithContextFS injects a context into the filesystem fs, if the filesystem supports it (i.e. has a WithContext method). This can be used to propagate cancellation.
func WithHTTPClientFS ¶
WithHTTPClientFS injects an HTTP client into the filesystem fs, if the filesystem supports it (i.e. has a WithHTTPClient method).
Types ¶
type FSMux ¶
FSMux allows you to dynamically look up a registered filesystem for a given URL. All filesystems provided in this module can be registered, and additional filesystems can be registered given an implementation of FSProvider. FSMux is itself an FSProvider, which provides the superset of all registered filesystems.
func (FSMux) Add ¶
func (m FSMux) Add(fs FSProvider)
Add registers the given filesystem provider for its supported URL schemes. If any of its schemes are already registered, they will be overridden.
type FSProvider ¶
type FSProvider interface { // Schemes returns the valid URL schemes for this filesystem Schemes() []string // New returns a filesystem from the given URL New(u *url.URL) (fs.FS, error) }
FSProvider provides a filesystem for a set of defined schemes
func FSProviderFunc ¶
FSProviderFunc -
func WrappedFSProvider ¶
func WrappedFSProvider(fsys fs.FS, schemes ...string) FSProvider
WrappedFSProvider is an FSProvider that returns the given fs.FS. When given a URL with a non-root path (i.e. not '/'), fs.Sub will be used to return a filesystem appropriate for the URL.
type WriteableFS ¶
type WriteableFile ¶
type WriteableFile interface { fs.File io.WriteCloser }
Directories ¶
Path | Synopsis |
---|---|
Package autofs provides the ability to look up all filesystems supported by this module.
|
Package autofs provides the ability to look up all filesystems supported by this module. |
Package awssmfs provides an interface to AWS Secrets Manager which allows you to interact with the Secrets Manager API as a standard filesystem.
|
Package awssmfs provides an interface to AWS Secrets Manager which allows you to interact with the Secrets Manager API as a standard filesystem. |
Package awssmpfs provides an interface to the AWS Systems Manager (SSM) Parameter Store which allows you to interact with the SSM Parameter Store API as a standard filesystem.
|
Package awssmpfs provides an interface to the AWS Systems Manager (SSM) Parameter Store which allows you to interact with the SSM Parameter Store API as a standard filesystem. |
Package blobfs provides an interface to blob stores such as Google Cloud Storage, Azure Blob Storage, or AWS S3, allowing you to interact with the store as a standard filesystem.
|
Package blobfs provides an interface to blob stores such as Google Cloud Storage, Azure Blob Storage, or AWS S3, allowing you to interact with the store as a standard filesystem. |
Package consulfs provides an interface to Hashicorp Consul which allows you to interact with the Consul K/V store as a standard filesystem.
|
Package consulfs provides an interface to Hashicorp Consul which allows you to interact with the Consul K/V store as a standard filesystem. |
Package examples contains example programs that demonstrate usage of go-fsimpl.
|
Package examples contains example programs that demonstrate usage of go-fsimpl. |
fscli
fscli is an example command-line application that uses go-fsimpl to perform a few basic filesystem operations.
|
fscli is an example command-line application that uses go-fsimpl to perform a few basic filesystem operations. |
Package filefs wraps os.DirFS to provide a local filesystem for file:// URLs.
|
Package filefs wraps os.DirFS to provide a local filesystem for file:// URLs. |
Package gitfs provides a read-only filesystem backed by a git repository.
|
Package gitfs provides a read-only filesystem backed by a git repository. |
Package httpfs provides a read-only filesystem that reads from an HTTP server.
|
Package httpfs provides a read-only filesystem that reads from an HTTP server. |
env
Package env contains functions that retrieve data from the environment
|
Package env contains functions that retrieve data from the environment |
Package vaultfs provides an interface to [Hashicorp Vault] which allows you to interact with the Vault API as a standard filesystem.
|
Package vaultfs provides an interface to [Hashicorp Vault] which allows you to interact with the Vault API as a standard filesystem. |
vaultauth
Package vaultauth provides an interface to a few custom Vault auth methods for use with github.com/helmwave/go-fsimpl/vaultfs, but which can also be used directly with a *github.com/hashicorp/vault/api.Client.
|
Package vaultauth provides an interface to a few custom Vault auth methods for use with github.com/helmwave/go-fsimpl/vaultfs, but which can also be used directly with a *github.com/hashicorp/vault/api.Client. |