Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
Field holds (previously) flattened metadata for an <extractor>.<section>.<field>
func ParseField ¶
parseField parses a flattened <extractor>.<section>.<field> into components
type PluginData ¶
type PluginData struct {
Sections Sections `json:"sections,omitempty"`
}
ExtractorData is returned by an extractor
type PluginInterface ¶
type PluginInterface interface { Name() string Description() string // This is probably a dumb way to do it, but it works IsExtractor() bool IsCreator() bool // Extractors Extract(bool) (PluginData, error) Validate() bool Sections() []string // Creators take a map of named options Create(PluginOptions) error }
A Plugin interface can define any of the following:
an Extract function to return extractor data across sections a validate function to typically check that the plugin is valid a Creation interface that can use extractor data to generate something new
type PluginOptions ¶
type PluginOptions struct { BoolOpts map[string]bool StrOpts map[string]string IntOpts map[string]int32 ListOpts map[string][]string }
PluginOptions allow packaging named values of different types This is an alternative to using interfaces.
type PluginSection ¶
An extractor section corresponds to a named group of attributes
type Plugins ¶
type Plugins map[string]PluginInterface
Extractors is a lookup of registered extractors by name
type Result ¶
type Result struct {
Results map[string]PluginData `json:"results,omitempty"`
}
A Result wraps named extractor data, just for easy dumping to json
func (*Result) AddCustomFields ¶
AddCustomFields adds or updates an existing result with custom metadata, either new or to overwrite
type Sections ¶
type Sections map[string]PluginSection