Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidSourceEmpty = fmt.Errorf("invalid source, must specify at least one type of source configuration")
Functions ¶
This section is empty.
Types ¶
type Entry ¶
Entry is a single sourced entry. It's just a basic map, but makes it much clearer when building lists of this type, as the type syntax can get a bit messy.
func Parse ¶ added in v0.9.0
Parse attempts to extract entries from content that is either Jsonnet, JSON or YAML.
It also supports multidoc YAML, and will either return the root object itself if that root is a map[string]any, or if the root is an array, will try returning the contents of said array that are map[string]any's.
type Source ¶
type Source struct { Local *SourceLocal `json:"local,omitempty"` Inline *SourceInline `json:"inline,omitempty"` Exec *SourceExec `json:"exec,omitempty"` }
Source is instantiated from configuration and represents a source of catalog files.
type SourceEntry ¶
SourceEntry is an entry that has been discovered in a source, with the contents of the source file and an Origin that explains where the entry came from, specific to the type of source that produced it.
func (SourceEntry) Parse ¶
func (e SourceEntry) Parse() ([]Entry, error)
type SourceExec ¶ added in v0.9.0
type SourceExec struct {
Command []string `json:"command"`
}
func (SourceExec) Load ¶ added in v0.9.0
func (s SourceExec) Load(ctx context.Context) ([]*SourceEntry, error)
func (SourceExec) Validate ¶ added in v0.9.0
func (s SourceExec) Validate() error
type SourceInline ¶
func (SourceInline) Load ¶
func (s SourceInline) Load(ctx context.Context) ([]*SourceEntry, error)
func (SourceInline) Validate ¶ added in v0.12.0
func (s SourceInline) Validate() error
type SourceLocal ¶
type SourceLocal struct {
Files []string `json:"files"`
}
func (SourceLocal) Load ¶
func (s SourceLocal) Load(ctx context.Context) ([]*SourceEntry, error)
func (SourceLocal) Validate ¶ added in v0.12.0
func (s SourceLocal) Validate() error