Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentInfo ¶
ContentInfo holds the content of a file and its path.
type Options ¶
type Options struct {
Paths []string `json:"paths" yaml:"paths"`
Extensions []string `json:"extensions" yaml:"extensions"`
Watch bool `json:"watch" yaml:"watch"`
Enabled bool `json:"enabled" yaml:"enabled"`
}
Options defines the configuration for the file provider.
type Provider ¶ added in v0.10.0
type Provider struct {
OnChanged provider.ChangeFunc
// contains filtered or unexported fields
}
Provider implements a configuration provider that reads from the local filesystem.
func NewProvider ¶
NewProvider creates a new FileProvider instance.
func (*Provider) Open ¶ added in v0.10.0
func (p *Provider) Open() ([]*ContentInfo, error)
Open reads all files from the configured paths and returns their content.
func (*Provider) Reset ¶ added in v0.10.0
func (p *Provider) Reset()
Reset clears the paths in the file provider.
func (*Provider) SetOnChanged ¶ added in v0.10.0
func (p *Provider) SetOnChanged(changeFunc provider.ChangeFunc)
SetOnChanged sets the callback function to be called when a file changes.
Click to show internal directories.
Click to hide internal directories.