Documentation
¶
Overview ¶
Package config contains configuration types for Korrel8r. These types can be loaded from YAML configuration files and/or used in a Kubernetes resource spec.
Index ¶
Constants ¶
const ( StoreKeyDomain = "domain" // Required domain name StoreKeyError = "error" // Error message if store failed to load. StoreKeyErrorCount = "errorCount" // Count of errors on a store. StoreKeyMock = "mockData" // Store loads mock data from a file or directory. StoreKeyCA = "certificateAuthority" // Path to CA certificate. )
Store keys that may be used by any stores.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Class ¶ added in v0.5.10
type Class struct { // Name is the short name for a group of classes. Name string `json:"name"` // Domain of the classes, all must be in the same domain. Domain string `json:"domain"` // Classes are the names of classes in this group. Classes []string `json:"classes"` }
Class defines a shortcut name for a set of existing classes.
type ClassSpec ¶
type ClassSpec struct { // Domain is the domain for selected classes. Domain string `json:"domain"` // Classes is a list of class names to be selected from the domain. // If absent, all classes in the domain are selected. Classes []string `json:"classes,omitempty"` }
ClassSpec specifies one or more classes.
type Config ¶
type Config struct { // Rules define the relationships that korrel8r will follow. Rules []Rule `json:"rules,omitempty"` // Aliases defines short names for groups of related classes. Aliases []Class `json:"aliases,omitempty"` // Stores is a list of store configurations. Stores []Store `json:"stores,omitempty"` // Include lists additional configuration files or URLs to include. Include []string `json:"include,omitempty"` // Tuning section has limits and optimizations. Tuning *Tuning `json:"tuning,omitempty"` // Soure of configuration, file or URL. Source string `json:"-"` }
Config defines the configuration for an instance of korrel8r. Configuration files may be JSON or YAML.
type Duration ¶ added in v0.7.5
func (Duration) MarshalJSON ¶ added in v0.7.5
func (*Duration) UnmarshalJSON ¶ added in v0.7.5
type ResultSpec ¶
type ResultSpec struct { // Query template generates a query object suitable for the goal store. Query string `json:"query"` }
ResultSpec contains templates to generate a result.
type Rule ¶
type Rule struct { // Name is a short, descriptive name. // If omitted, a name is generated from Start and Goal. Name string `json:"name,omitempty"` // Start specifies the set of classes that this rule can apply to. Start ClassSpec `json:"start"` // Goal specifies the set of classes that this rule can produce. Goal ClassSpec `json:"goal"` // TemplateResult contains templates to generate the result of applying this rule. // Each template is applied to an object from one of the `start` classes. // If any template yields a blank string or an error, the rule does not apply. Result ResultSpec `json:"result"` }
Rule configures a template rule.
The rule template is applied to a instance of the start object. It should generate one of the following: - a goal query string of the form DOAMAIN:CLASS:QUERY_DATA. - a blank (whitespace-only) string if the rule does not apply to the given object. - an error if something unexpected goes wrong.
If a rule returns an invalid query this will be logged as an error but will not prevent the progress on other rules. For expected conditions, returning blank generates less noise than an error.
type Store ¶
Store is a map of name:value attributes used to connect to a store. The names and values depend on the type of store.
type Tuning ¶ added in v0.7.5
type Tuning struct { // RequestTimeout cancel requests if they last longer than this timeout. // Cancelling a correlation operation may return an error or a partial result (HTTP 206). RequestTimeout Duration `json:"requestTimeout,omitempty"` }
Tuning section for limits and optimizations.