helper

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSubShell

func CreateSubShell(accountNumber string, accountAlias string, carName string, stak kion.STAK) error

CreateSubShell creates a subshell containing set variables for AWS short term access keys. It attempts to use the users configured shell and rc file while overriding the prompt to indicate the authed AWS account.

func FindCARByName

func FindCARByName(cars []kion.CAR, carName string) (*kion.CAR, error)

FindCARByName returns a CAR identified by its name.

func LoadConfig

func LoadConfig(filename string, config *structs.Configuration) error

LoadConfig reads in the configuration yaml file located at `configFile`.

func MapAccounts

func MapAccounts(accounts []kion.Account) ([]string, map[string]kion.Account)

MapAccounts transofrms a slice of Accounts into a slice of their names and a map indexed by their names.

func MapCAR

func MapCAR(cars []kion.CAR) ([]string, map[string]kion.CAR)

MapCAR transofrms a slice of CARs into a slice of their names and a map indexed by their names.

func MapFavs

func MapFavs(favs []structs.Favorite) ([]string, map[string]structs.Favorite)

MapFavs transofrms a slice of Favorites into a slice of their names and a map indexd by their names.

func MapIDMSs

func MapIDMSs(idmss []kion.IDMS) ([]string, map[string]kion.IDMS)

MapIDMSs transofrms a slice of IDMSs into a slice of their names and a map indexd by their names.

func MapProjects

func MapProjects(projects []kion.Project) ([]string, map[string]kion.Project)

MapProjects transofrms a slice of Projects into a slice of their names and a map indexed by their names.

func OpenBrowser

func OpenBrowser(url string) error

OpenBrowser opens up a URL in the users system default browser.

func PrintSTAK

func PrintSTAK(stak kion.STAK, account string) error

PrintSTAK prints out the short term access keys for AWS auth.

func PromptInput

func PromptInput(message string) (string, error)

PromptInput prompts the user to provide dynamic input.

func PromptPassword

func PromptPassword(message string) (string, error)

PromptPassword prompts the user to provide sensitive dynamic input.

func PromptSelect

func PromptSelect(message string, options []string) (string, error)

PromptSelect promps the user to select from a slice of options. It requires that the selection made be one of the options provided.

func RunCommand

func RunCommand(accountNumber string, accountAlias string, carName string, stak kion.STAK, cmd string, args ...string) error

RunCommand executes a one time command with AWS credentials set within the environment. Command output is sent dirctly to stdout / stderr.

func SaveConfig

func SaveConfig(filename string, config structs.Configuration) error

saveConfig saves the etirety of the current config to the users config file.

func SaveSession

func SaveSession(filename string, config structs.Configuration) error

SaveSession updates the session section only of the users config file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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