Documentation ¶
Overview ¶
The core functions which support this CLI tool.
Index ¶
- func ArrayFilter(vs [][]string, f func([]string) bool) [][]string
- func Contains(a, b string) bool
- func Execute()
- func GetConfig(profile string) aws.Config
- func Plural(count int, singular string, plural string) string
- func SendPathRequest(svc *ssm.SSM, args []string)
- func SendSingleRequest(svc *ssm.SSM, args []string)
- type Parameter
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayFilter ¶
Returns a new slice containing all strings in the slice that satisfy the predicate f.
Example ¶
parameters = ArrayFilter(parameters, func(v []string) bool { e := strings.Join([]string{v[0], v[1]}, " ") return Contains(e, filter) })
Output:
func Contains ¶
Case-insensitive strings.Contains().
Example ¶
parameters = ArrayFilter(parameters, func(v []string) bool { e := strings.Join([]string{v[0], v[1]}, " ") return Contains(e, filter) })
Output:
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GetConfig ¶
Using the SDK’s default configuration, loading additional config and credentials values from the environment variables, shared credentials, and shared configuration files.
Example ¶
cfg := GetConfig(cmd.Flag("profile").Value.String()) svc := ssm.New(cfg) SendPathRequest(svc, args)
Output:
func Plural ¶
Pluralize a noun based on its count.
Example ¶
fmt.Printf("%s matched.\n", Plural(len(parameters), "result", "results"))
Output:
func SendPathRequest ¶
Send the request for a PS Path to AWS, then stash the response into a global variable.
Example ¶
cfg := GetConfig(cmd.Flag("profile").Value.String()) svc := ssm.New(cfg) SendPathRequest(svc, args)
Output:
func SendSingleRequest ¶
Send the request for a single PS value to AWS, then stash the response into a global variable.