stim

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stim

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

func New

func New() *Stim

New gets the Stim struct, which is treated like a singleton so you will get the same one as everywhere when this is called

func (*Stim) AddStimpack added in v0.0.3

func (stim *Stim) AddStimpack(s Stimpack)

func (*Stim) Aws added in v0.0.3

func (stim *Stim) Aws(accessKey string, secretKey string) *aws.Aws

func (*Stim) BindCommand

func (stim *Stim) BindCommand(command *cobra.Command, parentCommand *cobra.Command)

func (*Stim) CreateConfigFile added in v0.0.3

func (stim *Stim) CreateConfigFile() (string, error)

CreateConfigFile will create the stim config file if it doesn't exist Used the frist time this code is ran so sub functions do not get errors when writting to the config.

func (*Stim) CreateDirIfNotExist added in v0.0.3

func (stim *Stim) CreateDirIfNotExist(dir string) error

func (*Stim) Debug

func (stim *Stim) Debug(message string)

func (*Stim) DebugError

func (stim *Stim) DebugError(err error)

func (*Stim) Execute

func (stim *Stim) Execute()

func (*Stim) Fatal

func (stim *Stim) Fatal(err error)

func (*Stim) Get

func (stim *Stim) Get(configKey string) interface{}

func (*Stim) GetConfig

func (stim *Stim) GetConfig(configKey string) string

func (*Stim) GetConfigBool

func (stim *Stim) GetConfigBool(configKey string) bool

GetConfigBool takes a config key and returns the boolean result

func (*Stim) GetLogger added in v0.0.4

func (stim *Stim) GetLogger() stimlog.StimLogger

GetLogger for Stim

func (*Stim) GetStimPath added in v0.0.4

func (stim *Stim) GetStimPath() (string, error)

func (*Stim) GetVersion

func (stim *Stim) GetVersion() string

func (*Stim) IsAutomated

func (stim *Stim) IsAutomated() bool

IsAutomated simply guesses if a build is invoking this code Used to disable user input prompts

func (*Stim) Kubernetes

func (stim *Stim) Kubernetes() *kubernetes.Kubernetes

func (*Stim) Pagerduty

func (stim *Stim) Pagerduty() *pagerduty.Pagerduty

Pagerduty returns a Pagerduty instance that is already authenticated

func (*Stim) Prometheus

func (stim *Stim) Prometheus() *prometheus.Prometheus

func (*Stim) PromptBool

func (stim *Stim) PromptBool(label string, override bool, defaultvalue bool) (bool, error)

PromptBool asks the user a yes/no question

func (*Stim) PromptList

func (stim *Stim) PromptList(label string, list []string, override string) (string, error)

PromptList prompts the user to select from the list of string provided If override string is not empty it will be returned without

func (*Stim) PromptListVault

func (stim *Stim) PromptListVault(vaultPath string, label string, override string) (string, error)

PromptListVault uses a path from vault and prompts to select the list of secrets within that list. Returns the value selected. If override string is not empty it will be returned without

func (*Stim) PromptSearchList added in v0.0.3

func (stim *Stim) PromptSearchList(label string, list []string) (string, error)

PromptSearchList takes a label, list of selectable values and prompts the user to select the results. If override string is not empty it will be returned without prompting

func (*Stim) PromptString

func (stim *Stim) PromptString(label string, defaultvalue string) (string, error)

PromptString prompts the user to enter a string

func (*Stim) Set

func (stim *Stim) Set(key string, value string)

func (*Stim) Slack added in v0.0.3

func (stim *Stim) Slack() *slack.Slack

func (*Stim) UpdateConfigFileKey

func (stim *Stim) UpdateConfigFileKey(key string, value string) error

func (*Stim) UpdateVaultUser

func (stim *Stim) UpdateVaultUser(username string) error

UpdateVaultUser updates the user's stim config file with given username This username will be the default option when authenticating against Vault

func (*Stim) User

func (stim *Stim) User() (string, error)

func (*Stim) Vault

func (stim *Stim) Vault() *vault.Vault

Vault is the interface for Hashicorp Vault wrapper methods The main input is the vault-address Will prompt the user for their LDAP username and password Will update the user's ~/.vault-token file with a new token

type Stimpack added in v0.0.3

type Stimpack interface {
	Command(*viper.Viper) *cobra.Command
	Name() string
	BindStim(*Stim)
}

This is the interface for stimpacks

Jump to

Keyboard shortcuts

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