Documentation ¶
Index ¶
- Constants
- func SetTemplater(templFnc func(io.Writer, string, interface{}) error)
- type ChangeableFeatureValue
- type ChangeableFeatureValueS
- func (c ChangeableFeatureValueS) ClearDirt()
- func (c ChangeableFeatureValueS) FindByFeatureAndProvider(featureName, provider string) (*ChangeableFeatureValue, bool)
- func (c ChangeableFeatureValueS) FindByFeatureName(featureName string) (f ChangeableFeatureValueS)
- func (c ChangeableFeatureValueS) FindByProvider(provider string) (f ChangeableFeatureValueS)
- func (c ChangeableFeatureValueS) FindChanged() (f ChangeableFeatureValueS)
- func (c ChangeableFeatureValueS) GetFeaturesString() string
- func (c ChangeableFeatureValueS) GetProviderString() string
- func (c ChangeableFeatureValueS) ToHTMLTable() (string, error)
- func (c ChangeableFeatureValueS) ToTextTable() (string, error)
- type ChangeableValue
- type FeatChecker
- type Feature
- type FeatureDocumentation
- type FeatureStructure
- type FeatureValue
- type FeatureValues
- type HeadedFeature
- type SpecStandard
- type SpecStandards
- type ValueExplanation
Constants ¶
const ( FeatureTypeDynamic = iota FeatureTypeManual FeatureTypeCommunity )
Constants for the different feature types.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChangeableFeatureValue ¶
type ChangeableFeatureValue struct { Provider string FeatureName string Value ChangeableValue }
ChangeableFeatureValue associates a ChangeableValue with a FeatureName and Provider
type ChangeableFeatureValueS ¶
type ChangeableFeatureValueS []*ChangeableFeatureValue
ChangeableFeatureValueS is a slice of ChangeableFeatureValues
func (ChangeableFeatureValueS) ClearDirt ¶
func (c ChangeableFeatureValueS) ClearDirt()
ClearDirt clears the dirty bool
func (ChangeableFeatureValueS) FindByFeatureAndProvider ¶
func (c ChangeableFeatureValueS) FindByFeatureAndProvider(featureName, provider string) (*ChangeableFeatureValue, bool)
FindByFeatureAndProvider finds the first ChangeableFeatureValue in this slice with the given feature name and provider
func (ChangeableFeatureValueS) FindByFeatureName ¶
func (c ChangeableFeatureValueS) FindByFeatureName(featureName string) (f ChangeableFeatureValueS)
FindByFeatureName finds all ChangeableFeatureValues in this slice with the given featureName
func (ChangeableFeatureValueS) FindByProvider ¶
func (c ChangeableFeatureValueS) FindByProvider(provider string) (f ChangeableFeatureValueS)
FindByProvider finds all ChangeableFeatureValues in this slice with the given provider
func (ChangeableFeatureValueS) FindChanged ¶
func (c ChangeableFeatureValueS) FindChanged() (f ChangeableFeatureValueS)
FindChanged finds all ChangeableFeatureValues that have changed
func (ChangeableFeatureValueS) GetFeaturesString ¶
func (c ChangeableFeatureValueS) GetFeaturesString() string
GetFeaturesString returns a string presentation (json array) of all feature names in this slice
func (ChangeableFeatureValueS) GetProviderString ¶
func (c ChangeableFeatureValueS) GetProviderString() string
GetProviderString returns a string presentation (json array) of all providers in this slice
func (ChangeableFeatureValueS) ToHTMLTable ¶
func (c ChangeableFeatureValueS) ToHTMLTable() (string, error)
ToHTMLTable returns a html table representation (for email notifications)
func (ChangeableFeatureValueS) ToTextTable ¶
func (c ChangeableFeatureValueS) ToTextTable() (string, error)
ToTextTable returns a ascii table representation (for email notifications)
type ChangeableValue ¶
type ChangeableValue struct { Init interface{} Last interface{} Current interface{} Dirty bool }
ChangeableValue holds a value that can change multiple times. It holds the initial value, the last value and the current one.
func (*ChangeableValue) Changed ¶
func (v *ChangeableValue) Changed() bool
Changed checks if the value changed from last to current
type FeatChecker ¶
type FeatChecker = func(featureName string, c *provider.ClientConfig) interface{}
FeatChecker is a function that checks a given feature and returns its value.
type Feature ¶
type Feature struct { Name string Type uint8 Colorisation uint8 Check FeatChecker `json:"-"` GetValue featValueGetter `json:"-"` Documentation FeatureDocumentation `json:"-"` CommunityObserver *observer.Observer `json:"-"` }
Feature describes an orpheus feature. An orpheus feature can be of different types (dynamic, community, manual) and can vary in complexity.
func (*Feature) MarshalBinary ¶
MarshalBinary marshals Feature into bytes.
func (*Feature) UnmarshalBinary ¶
UnmarshalBinary unmarshalls bytes into Feature.
type FeatureDocumentation ¶
type FeatureDocumentation struct { Synopsis string `yaml:"synop"` Description string `yaml:"desc"` ValueExplanations []ValueExplanation `yaml:"values"` RelatedFeatures []string `yaml:"related_features"` RelevantStandards SpecStandards `yaml:"standards"` }
FeatureDocumentation represents the documentation of a feature.
func (FeatureDocumentation) Check ¶
func (fd FeatureDocumentation) Check(loadedFeatures []Feature, featureName string) (ok bool)
Check checks if a FeatureDocumentation is ok. Check asserts that a synopsis and description is provided and that all provided RelatedFeatures are loaded. Check also warns if no ValueExplanations are provided.
type FeatureStructure ¶
type FeatureStructure struct { Features []HeadedFeature NumberDynamic uint NumberCommunity uint NumberManual uint }
FeatureStructure holds a structure of Features.
func (*FeatureStructure) Add ¶
func (fs *FeatureStructure) Add(hf HeadedFeature)
Add adds a HeadedFeature to the FeatureStructure
type FeatureValue ¶
type FeatureValue struct { Feature Feature Value interface{} LastChecked time.Time // Only needed for community features }
FeatureValue associates a Feature with a value.
func (*FeatureValue) MarshalBinary ¶
func (f *FeatureValue) MarshalBinary() ([]byte, error)
MarshalBinary marshals FeatureValue into bytes.
func (*FeatureValue) UnmarshalBinary ¶
func (f *FeatureValue) UnmarshalBinary(data []byte) error
UnmarshalBinary unmarshalls bytes into FeatureValue.
func (*FeatureValue) Update ¶
func (f *FeatureValue) Update(value interface{})
Update updates the value of a FeatureValue to the given value and updates the time when it was updated.
type FeatureValues ¶
type FeatureValues []*FeatureValue
FeatureValues is a slice of *FeatureValue.
func (FeatureValues) Find ¶
func (fs FeatureValues) Find(featureName string) (*FeatureValue, bool)
Find returns a FeatureValue from a list of FeatureValue and a bool indicating if a value was found.
func (FeatureValues) MarshalBinary ¶
func (fs FeatureValues) MarshalBinary() ([]byte, error)
MarshalBinary marshals FeatureValues into bytes.
func (*FeatureValues) UnmarshalBinary ¶
func (fs *FeatureValues) UnmarshalBinary(data []byte) error
UnmarshalBinary unmarshalls bytes into FeatureValues.
type HeadedFeature ¶
HeadedFeature is a list of features with a heading.
type SpecStandard ¶
SpecStandard holds information about a specification standard.
type SpecStandards ¶
type SpecStandards []SpecStandard
SpecStandards is a slice of SpecStandard
func (SpecStandards) Names ¶
func (ss SpecStandards) Names() (names []string)
Names returns a slice of the Names of these SpecStandards
type ValueExplanation ¶
type ValueExplanation struct { Value string `yaml:"value"` Explanation string `yaml:"explanation"` }
ValueExplanation describes a value.