Documentation ¶
Index ¶
- Constants
- Variables
- type AttributeManager
- func (m *AttributeManager) GetAttrFromArguments(name, arg1, arg2 string) *taxonomy.InfrastructureElement
- func (m *AttributeManager) GetAttribute(name, instance string) *taxonomy.InfrastructureElement
- func (m *AttributeManager) GetAttributeValue(name, instance string) (string, bool)
- func (m *AttributeManager) GetInstanceTypes(name string) []taxonomy.InstanceType
- func (m *AttributeManager) GetNormAttrValFromArgs(name, arg1, arg2 string) (string, error)
- func (m *AttributeManager) GetNormalizedAttributeValue(name, instance string) (string, error)
- func (m *AttributeManager) GetOptions() monitor.FileMonitorOptions
- func (m *AttributeManager) OnError(err error)
- func (m *AttributeManager) OnNotify()
- type MetricsDictionary
Constants ¶
const InfrastructureInfo string = "infrastructure.json"
A json file containing the infrastructure information
const NormalizationFactor = 100
Variables ¶
var RegoPolicyDirectory = environment.GetDataDir() + "/adminconfig/"
RegoPolicyDirectory is a directory containing rego files that define admin config policies
var ValidationPath = environment.GetDataDir() + "/taxonomy/infraattributes.json#/definitions/Infrastructure"
Functions ¶
This section is empty.
Types ¶
type AttributeManager ¶
type AttributeManager struct { Log zerolog.Logger // attribute specific values Attributes []taxonomy.InfrastructureElement // metrics Metrics MetricsDictionary Mux *sync.RWMutex }
AttributeManager provides access to infrastructure attributes
func NewAttributeManager ¶
func NewAttributeManager() (*AttributeManager, error)
func (*AttributeManager) GetAttrFromArguments ¶ added in v1.0.0
func (m *AttributeManager) GetAttrFromArguments(name, arg1, arg2 string) *taxonomy.InfrastructureElement
Returns an infrastructure attribute based on the attribute name and two arguments to match
func (*AttributeManager) GetAttribute ¶
func (m *AttributeManager) GetAttribute(name, instance string) *taxonomy.InfrastructureElement
GetAttributeValue returns the value of an infrastructure attribute based on the attribute and instance names
func (*AttributeManager) GetAttributeValue ¶ added in v1.0.0
func (m *AttributeManager) GetAttributeValue(name, instance string) (string, bool)
GetAttributeValue returns the value of an infrastructure attribute based on the attribute and instance names
func (*AttributeManager) GetInstanceTypes ¶ added in v1.0.0
func (m *AttributeManager) GetInstanceTypes(name string) []taxonomy.InstanceType
GetInstanceType returns instance types associated with the attribute
func (*AttributeManager) GetNormAttrValFromArgs ¶ added in v1.0.0
func (m *AttributeManager) GetNormAttrValFromArgs(name, arg1, arg2 string) (string, error)
// returns the normalized-to-scale value of an infrastructure attribute based on the attribute and two arguments to match
func (*AttributeManager) GetNormalizedAttributeValue ¶ added in v1.0.0
func (m *AttributeManager) GetNormalizedAttributeValue(name, instance string) (string, error)
returns the normalized-to-scale value of an infrastructure attribute based on the attribute and instance names
func (*AttributeManager) GetOptions ¶
func (m *AttributeManager) GetOptions() monitor.FileMonitorOptions
Options for file monitor including the monitored directory and the relevant file extension
func (*AttributeManager) OnError ¶
func (m *AttributeManager) OnError(err error)
notification from the file system monitor about an error while getting access to the infrastructure file
func (*AttributeManager) OnNotify ¶
func (m *AttributeManager) OnNotify()
notification from the file monitor on change in the infrastructure json file
type MetricsDictionary ¶ added in v1.0.0
type MetricsDictionary map[string]taxonomy.InfrastructureMetrics