config

package
v5.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CP_STR  = 0
	CP_INT  = 1
	CP_BOOL = 2
)

Variables

This section is empty.

Functions

func AddParm added in v5.2.0

func AddParm(loc interface{}, defaultValue interface{}, parmType int, cliName string, envSection string, envName string, usage string)

func AsBool added in v5.5.4

func AsBool(s string, def bool) bool

The Go YAML parsing is not what you might expect for booleans - you are apparently unable to set a default of "true" for missing fields. So we read it as a string and parse that. The caller also sends in the default value if the string cannot be decoded.

func CopyDeprecatedParmIfNotSetBool added in v5.3.0

func CopyDeprecatedParmIfNotSetBool(section string, name string, val bool) bool

func CopyDeprecatedParmIfNotSetStr added in v5.3.0

func CopyDeprecatedParmIfNotSetStr(section string, name string, val string) string

func CopyDeprecatedParmIfNotSetStrArray added in v5.3.0

func CopyDeprecatedParmIfNotSetStrArray(section string, name string, val []string) string

func CopyParmIfNotSetBool added in v5.2.0

func CopyParmIfNotSetBool(section string, name string, val bool) bool

If the parameter has already been set by env var or cli, then the value in the main config structure is returned. Otherwise the value passed as the "val" parameter - from the YAML version of the configuration elements - is returned

func CopyParmIfNotSetInt added in v5.2.0

func CopyParmIfNotSetInt(section string, name string, val int) int

func CopyParmIfNotSetStr added in v5.2.0

func CopyParmIfNotSetStr(section string, name string, val string) string

func CopyParmIfNotSetStrArray added in v5.2.0

func CopyParmIfNotSetStrArray(section string, name string, val []string) string

func CopyYamlConfig

func CopyYamlConfig(cm *Config, cyg ConfigYGlobal, cyc ConfigYConnection, cyo ConfigYObjects, cyf ConfigYFilters)

This handles the configuration parameters that are common to all the collectors. The individual collectors call similar code for their own specific attributes

func GetPasswordFromFile

func GetPasswordFromFile(file string, removeFile bool) (string, error)

func GetPasswordFromStdin

func GetPasswordFromStdin(prompt string) string

func InitConfig

func InitConfig(cm *Config)

func InitLog

func InitLog(cm Config)

func MqGolangVersion added in v5.5.0

func MqGolangVersion() string

func ParseParms added in v5.2.0

func ParseParms() error

func PrintInfo

func PrintInfo(title string, stamp string, commit string, buildPlatform string)

func ReadConfigFile

func ReadConfigFile(f string, cmy interface{}) error

func VerifyConfig

func VerifyConfig(cm *Config, fullCf interface{}) error

Types

type Config

type Config struct {
	ConfigFile string

	QMgrName string
	ReplyQ   string
	ReplyQ2  string

	MetaPrefix string

	TZOffsetString string
	Locale         string

	MonitoredQueues            string
	MonitoredQueuesFile        string
	MonitoredChannels          string
	MonitoredChannelsFile      string
	MonitoredAMQPChannels      string
	MonitoredAMQPChannelsFile  string
	MonitoredTopics            string
	MonitoredTopicsFile        string
	MonitoredSubscriptions     string
	MonitoredSubscriptionsFile string
	QueueSubscriptionSelector  string

	MetadataTagsArray   []string
	MetadataValuesArray []string

	LogLevel string

	PollIntervalDuration time.Duration

	RediscoverDuration time.Duration

	CC mqmetric.ConnectionConfig
	// contains filtered or unexported fields
}

Configuration attributes shared by all the monitor sample programs

type ConfigMoved added in v5.3.0

type ConfigMoved struct {
	QueueSubscriptionSelector string
	ShowInactiveChannels      string
}

type ConfigParm added in v5.2.0

type ConfigParm struct {
	// contains filtered or unexported fields
}

type ConfigYConnection

type ConfigYConnection struct {
	QueueManager     string `yaml:"queueManager"`
	User             string
	Client           string `yaml:"clientConnection" default:"false"`
	Password         string
	ReplyQueue       string   `yaml:"replyQueue" `
	ReplyQueue2      string   `yaml:"replyQueue2"`
	DurableSubPrefix string   `yaml:"durableSubPrefix"`
	CcdtUrl          string   `yaml:"ccdtUrl"`
	ConnName         string   `yaml:"connName"`
	Channel          string   `yaml:"channel"`
	WaitInterval     string   `yaml:"waitInterval"`
	MetadataTags     []string `yaml:"metadataTags"`
	MetadataValues   []string `yaml:"metadataValues"`
}

type ConfigYFilters added in v5.3.0

type ConfigYFilters struct {
	HideSvrConnJobname        string   `yaml:"hideSvrConnJobname" default:"false"`
	HideAMQPClientId          string   `yaml:"hideAMQPClientId" default:"false"`
	ShowInactiveChannels      string   `yaml:"showInactiveChannels" default:"false"`
	QueueSubscriptionSelector []string `yaml:"queueSubscriptionSelector"`
}

type ConfigYGlobal

type ConfigYGlobal struct {
	UseObjectStatus    string `yaml:"useObjectStatus" default:"true"`
	UseResetQStats     string `yaml:"useResetQStats" default:"false"`
	UsePublications    string `yaml:"usePublications" default:"true"`
	LogLevel           string `yaml:"logLevel"`
	MetaPrefix         string
	PollInterval       string `yaml:"pollInterval"`
	RediscoverInterval string `yaml:"rediscoverInterval"`
	TZOffset           string `yaml:"tzOffset"`
	Locale             string
}

type ConfigYObjects

type ConfigYObjects struct {
	Queues        []string
	Channels      []string
	AMQPChannels  []string `yaml:"amqpChannels"`
	Topics        []string
	Subscriptions []string
	// These are left here for now so they can be recognised but will cause an error because the
	// real values have moved
	QueueSubscriptionSelector []string `yaml:"queueSubscriptionSelector"`
	ShowInactiveChannels      string   `yaml:"showInactiveChannels" default:"false"`
}

Jump to

Keyboard shortcuts

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