translator

package
v1.3000030.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorMessages = []string{}

ErrorMessages will provide detail error messages to user

View Source
var InfoMessages = []string{}
View Source
var ValidDays = map[int]bool{}
View Source
var ValidRetentionInDays = []string{"-1", "1", "3", "5", "7", "14", "30", "60", "90", "120", "150", "180", "365", "400", "545", "731", "1096", "1827", "2192", "2557", "2922", "3288", "3653"}

ValidRetentionInDays is based on what's supported by PutRetentionPolicy. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html#CloudWatch-Agent-Configuration-File-Logssection.

Functions

func AddErrorMessages

func AddErrorMessages(path, message string)

func AddInfoMessages

func AddInfoMessages(path, message string)

func DefaultCase

func DefaultCase(key string, defaultVal, input interface{}) (returnKey string, returnVal interface{})

DefaultCase check if current input overrides the default value for the given config entry key.

func DefaultIntegralCase

func DefaultIntegralCase(key string, defaultVal, input interface{}) (returnKey string, returnVal interface{})

func DefaultRetentionInDaysCase added in v1.247350.0

func DefaultRetentionInDaysCase(key string, defaultVal, input interface{}) (returnKey string, returnVal interface{})

func DefaultStringArrayCase

func DefaultStringArrayCase(key string, defaultVal, input interface{}) (returnKey string, returnVal interface{})

func DefaultTimeIntervalCase

func DefaultTimeIntervalCase(key string, defaultVal, input interface{}) (returnKey string, returnVal interface{})

func GetTargetPlatform

func GetTargetPlatform() string

func InitWindowsObject

func InitWindowsObject(objectName, instances, counters, measurement string) map[string]interface{}

func IsTranslateSuccess

func IsTranslateSuccess() bool

func IsValid

func IsValid(input interface{}, key string, path string) bool

IsValid checks whether the mandatory config parameter is valid

func IsValidRetentionDays added in v1.247350.0

func IsValidRetentionDays(days int) bool

func MergePlugins

func MergePlugins(map1 map[string]interface{}, map2 map[string]interface{}) map[string]interface{}

Don't modify map1 or map2, it's hard to make sure we don't reference map1 or map2 reference in whole proj This method is mainly to merge different plugins or multiple instances of same plugins

func MergeTwoUniqueMaps

func MergeTwoUniqueMaps(map1 map[string]interface{}, map2 map[string]interface{}) map[string]interface{}

Don't modify map1 or map2, it's hard to make sure we don't reference map1 or map2 reference in whole proj This method is mainly to merge maps which don't have same key, it's a shallow merge. Fail this method if not serving this purpose.

func ProcessDefaultConfig

func ProcessDefaultConfig(childRule map[string]Rule, result map[string]interface{}) map[string]interface{}

ProcessDefaultConfig process the input when user want to use the default configuration. In json the default configuration should be like "cpu":"default"

func ProcessNoRuleToApply

func ProcessNoRuleToApply(input interface{}, childRule map[string]Rule, result map[string]interface{}) map[string]interface{}

ProcessNoRuleToApply check if the the specification configuration provides some configs that don't need translation with rules. In this case, the translation of this config entry should be 1:1 map In json the default configuration should be like "cpu":{"interval":"10s"}

func ProcessRuleToApply

func ProcessRuleToApply(input interface{}, childRule map[string]Rule, result map[string]interface{}) map[string]interface{}

ProcessRuleToApply check if the specification configuration provide some configs that need translation with some rules In json the default configuration should be like "cpu":{"per_cpu":false}

func ResetMessages

func ResetMessages()

Used for testing purpose

func SetTargetPlatform

func SetTargetPlatform(targetPlatform string)

Types

type Rule

type Rule interface {
	ApplyRule(interface{}) (string, interface{})
}

Concrete Rule implementation should return a (key string,val interface{})

Directories

Path Synopsis
tocwconfig
csm

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL