Documentation
¶
Overview ¶
Package providers implements a base FS-based configuration provider.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FSProvider ¶
type FSProvider struct {
// contains filtered or unexported fields
}
FSProvider provides file system operations by wrapping an fs.FS implementation. It is used as a base provider for other file-based configuration providers.
func NewFSProvider ¶
func NewFSProvider(fileFS fs.FS) *FSProvider
NewFSProvider creates a new FSProvider with the given fs.FS implementation. If fileFS is nil, it defaults to using sysfs.NewSysFS().
func (*FSProvider) OpenFile ¶
func (p *FSProvider) OpenFile(name string) (fs.File, error)
OpenFile opens the named file using the underlying fs.FS implementation.
func (*FSProvider) ReadFile ¶
func (p *FSProvider) ReadFile(name string) ([]byte, error)
ReadFile reads the named file using the underlying fs.FS implementation.
func (*FSProvider) SetFS ¶
func (p *FSProvider) SetFS(fileFS fs.FS)
SetFS sets the underlying fs.FS implementation.
Click to show internal directories.
Click to hide internal directories.