cmd

package
v0.0.0-...-3689411 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

The core functions which support this CLI tool.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayFilter

func ArrayFilter(vs [][]string, f func([]string) bool) [][]string

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

func Contains(a, b string) bool

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

func GetConfig(profile string) aws.Config

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

func Plural(count int, singular string, plural string) string

Pluralize a noun based on its count.

Example
fmt.Printf("%s matched.\n", Plural(len(parameters), "result", "results"))
Output:

func SendPathRequest

func SendPathRequest(svc *ssm.SSM, args []string)

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

func SendSingleRequest(svc *ssm.SSM, args []string)

Send the request for a single PS value to AWS, then stash the response into a global variable.

Types

type Parameter

type Parameter struct {
	Profile string
	Name    string
	Type    string
	Value   string
}

Jump to

Keyboard shortcuts

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