stim

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvConfig added in v0.1.3

type EnvConfig struct {

	// EnvVars slice of environment variables to be set
	// Values look like "FOO=BAR"
	EnvVars []string

	// Kubernetes env config
	Kubernetes *EnvConfigKubernetes

	// Kubernetes env config
	Vault *EnvConfigVault

	// WorkDir sets the working directory where any shell commands will be executed
	WorkDir string

	// Tools should contains a list of supported binary tools to install and link
	Tools map[string]EnvTool
}

EnvConfig represets a environment configuration

type EnvConfigKubernetes added in v0.1.3

type EnvConfigKubernetes struct {

	// Cluster is the name of the Kubernetes cluster to set up
	Cluster string

	// ServiceAccount to use when connecting to Kubernetes
	ServiceAccount string

	// DefaultNamespace to use when setting up Kubernetes
	DefaultNamespace string
}

EnvConfig represets a environment's Kubernetes configuration

type EnvConfigVault added in v0.1.3

type EnvConfigVault struct {

	// SecretItems to load into the environment
	SecretItems []*vaulttoenvs.SecretItem
}

EnvConfig represets a environment's Vault configuration

type EnvTool added in v0.1.3

type EnvTool struct {
	Version string `yaml:"version"`
	Unset   bool   `yaml:"unset"`
}

EnvTool contains the configuration for a CLI tool

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) ConfigGetBool added in v0.0.7

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

GetConfigBool takes a config key and returns the boolean result

func (*Stim) ConfigGetCacheDir added in v0.1.3

func (stim *Stim) ConfigGetCacheDir(subDir string) string

ConfigGetStimCacheDir returns the stim cache directory subdir paramter optionally provides a subdirectory within the cache

func (*Stim) ConfigGetDuration added in v0.3.0

func (stim *Stim) ConfigGetDuration(configKey string) time.Duration

func (*Stim) ConfigGetRaw added in v0.0.7

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

func (*Stim) ConfigGetStimConfigDir added in v0.0.7

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

func (*Stim) ConfigGetStimConfigFile added in v0.0.7

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

ConfigGetStimConfigFile gets the current stim config file (creating it if necessary)

func (*Stim) ConfigGetString added in v0.0.7

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

func (*Stim) ConfigHasValue added in v0.0.7

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

func (*Stim) ConfigRemoveKey added in v0.0.7

func (stim *Stim) ConfigRemoveKey(key string) error

func (*Stim) ConfigSetBool added in v0.0.7

func (stim *Stim) ConfigSetBool(key string, value bool) error

func (*Stim) ConfigSetDefaultValues added in v0.3.0

func (stim *Stim) ConfigSetDefaultValues()

func (*Stim) ConfigSetRaw added in v0.0.7

func (stim *Stim) ConfigSetRaw(key string, value interface{}) error

func (*Stim) ConfigSetString added in v0.0.7

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

func (*Stim) Debug

func (stim *Stim) Debug(message string)

func (*Stim) DebugError

func (stim *Stim) DebugError(err error)

func (*Stim) Env added in v0.1.3

func (stim *Stim) Env(config *EnvConfig) *env.Env

Env sets up an environment based on the given config Shell commands can be executed against the environment

func (*Stim) Execute

func (stim *Stim) Execute()

func (*Stim) Fatal

func (stim *Stim) Fatal(err error)

func (*Stim) GetCompletion added in v0.2.0

func (stim *Stim) GetCompletion(shell string) error

func (*Stim) GetLogger added in v0.0.4

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

GetLogger for Stim

func (*Stim) GetVersion

func (stim *Stim) GetVersion() string

func (*Stim) IsAutomated

func (stim *Stim) IsAutomated() bool

Used to disable user input prompts

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, defaultedValue string, regex 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) Slack added in v0.0.3

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

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 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