Documentation ¶
Overview ¶
Package cmd is the application CLI.
Index ¶
- func ConcurrentRunner(p provider.IProvider, cmds []string, args []string)
- func CreateBridge()
- func DumpToFile(file *os.File, finalValues map[string]string, rawValue bool) error
- func Execute()
- func LoadFromText(shouldOverride, rawValue bool, contentFormat, data string) (provider.IProvider, error)
- func RunnerBridge(args []string)
- func ValidateConnection()
- type CommandArgs
- type ElasticSearchConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConcurrentRunner ¶ added in v1.1.8
ConcurrentRunner runs the commands concurrently.
func DumpToFile ¶ added in v1.1.6
DumpToFile dumps the final loaded values to a file. Extension is used to determine the format.
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately.
func LoadFromText ¶ added in v1.3.22
func LoadFromText( shouldOverride, rawValue bool, contentFormat, data string, ) (provider.IProvider, error)
LoadFromText loads configuration data from a text source and returns an instance of the provider and a map of the loaded data.
The function takes the following parameters: - shouldOverride: Override the current env var values with loaded ones. The default behaviour is the current env var values take precedence. - rawValue: If set, will not parse (escaping sequecence, etc) values. - contentFormat: A string specifying the format of the content to be loaded (e.g., "json", "yaml", "xml"). - data: A string containing the actual content to be loaded.
The function returns an instance of the provider (implementing the IProvider interface) and a map[string]interface{} containing the loaded data. If an error occurs during the loading process, the function will log the error and terminate the program.
func RunnerBridge ¶ added in v1.3.2
func RunnerBridge(args []string)
RunnerBridge runs the bridge and command.
func ValidateConnection ¶ added in v1.3.3
func ValidateConnection()
ValidateConnection validates the connection.
Types ¶
type CommandArgs ¶ added in v1.2.15
type CommandArgs struct { // Arguments to pass to the command. Args []string `json:"args"` // Command to run. Command string `json:"command"` }
CommandArgs represents the command and its arguments.
type ElasticSearchConfig ¶ added in v1.3.6
type ElasticSearchConfig struct { // Addresses is the list of addresses to connect to. Defaults to // "http://localhost:9200". Addresses []string `json:"addresses"` // APIKey is one way of authenticating to the ElasticSearch cluster using // ElasticSearch API Key. APIKey string `json:"apiKey,omitempty"` // CloudID is one way of authenticating to the ElasticSearch cluster using // Elastic Cloud. CloudID string `json:"cloudId,omitempty"` // Index to write events to. Defaults to "configurer". Index string `json:"index"` // Password and Username are one way of authenticating to the ElasticSearch // cluster. Password string `json:"password,omitempty"` Username string `json:"username,omitempty"` // ServiceToken is one way of authenticating to the ElasticSearch cluster. ServiceToken string `json:"serviceToken,omitempty"` }
ElasticSearchConfig represents the ElasticSearch configuration.