Documentation
¶
Overview ¶
Package source is a base for all config sources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Plugins = container.NewList[Source]() //nolint:gochecknoglobals
Plugins is the configsource plugin container.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct {
// Source URL.
URL *url.URL
// Data holder.
Data map[string]any
// The Marshaler used to create Data -> map[string]any
Marshaler marshaler.Marshaler
// If there was an error while processing the URL.
Error error
// AdditionalConfigs is a list of configs that we also have to read.
// or that have been injected by config.Read().
AdditionalConfigs []*url.URL
}
Data holds a single config file marshaled to map[string]any.
type Source ¶
type Source interface {
fmt.Stringer
// Schemes is a slice of schemes this reader supports.
Schemes() []string
// PrependSections indicates whether config.Read() has to prepend the result
// with sections.
PrependSections() bool
// Read reads the url in u and returns it as map[string]any.
Read(u *url.URL) Data
}
Source is a config source.
Click to show internal directories.
Click to hide internal directories.