Documentation ¶
Overview ¶
Package aid assist Cobra commands individually. Example: a command under `cmd/foo.go`, has its respective `aid/foo.go`. This allows a more cleaner and readable code.
Index ¶
- func CheckAppDirAndFile() error
- func DeleteConfigurationsDirectory() error
- func FindVariableByKey(list *tfe.VariableList, cmd *cobra.Command) (*tfe.Variable, error)
- func GetAppInfo() model.App
- func GetConfigurationVersionCreateOptions(cmd *cobra.Command) tfe.ConfigurationVersionCreateOptions
- func GetCredentialProfileFlags(cmd *cobra.Command) model.CredentialProfile
- func GetOAuthClientCreateOptions(cmd *cobra.Command) tfe.OAuthClientCreateOptions
- func GetOAuthTokenUpdateOptions(cmd *cobra.Command) tfe.OAuthTokenUpdateOptions
- func GetRunApplyOptions(cmd *cobra.Command) tfe.RunApplyOptions
- func GetRunCancelOptions(cmd *cobra.Command) tfe.RunCancelOptions
- func GetRunCreateOptions(cmd *cobra.Command) tfe.RunCreateOptions
- func GetRunDiscardOptions(cmd *cobra.Command) tfe.RunDiscardOptions
- func GetRunForceCancelOptions(cmd *cobra.Command) tfe.RunForceCancelOptions
- func GetRunReadOptions(cmd *cobra.Command) tfe.RunReadOptions
- func GetSSHKeyByName(list *tfe.SSHKeyList, name string) tfe.SSHKey
- func GetSSHKeysCreateOptions(cmd *cobra.Command) tfe.SSHKeyCreateOptions
- func GetSSHKeysUpdateOptions(cmd *cobra.Command) tfe.SSHKeyUpdateOptions
- func GetSensitiveUserInput(cmd *cobra.Command, text string, info string) (string, error)
- func GetSensitiveUserInputAsString(cmd *cobra.Command, text string, info string) string
- func GetTFEClient(token string) *tfe.Client
- func GetUserInputAsBool(cmd *cobra.Command, text string, info bool) bool
- func GetUserInputAsString(cmd *cobra.Command, text string, info string) string
- func GetVCSRepoFlags(cmd *cobra.Command) tfe.VCSRepoOptions
- func GetVariableCreateOptions(cmd *cobra.Command) tfe.VariableCreateOptions
- func GetVariableUpdateOptions(cmd *cobra.Command) tfe.VariableUpdateOptions
- func GetWorkspaceAssignSSHKeyOptions(cmd *cobra.Command) tfe.WorkspaceAssignSSHKeyOptions
- func GetWorkspaceCreateOptions(cmd *cobra.Command) tfe.WorkspaceCreateOptions
- func GetWorkspaceListOptions(cmd *cobra.Command) tfe.WorkspaceListOptions
- func GetWorkspaceUpdateOptions(cmd *cobra.Command) tfe.WorkspaceUpdateOptions
- func HasCreatedAppDir(cmd *cobra.Command) (bool, error)
- func LoadViper()
- func PrintConfigurationVersionList(list *tfe.ConfigurationVersionList)
- func PrintOAuthClientList(list *tfe.OAuthClientList)
- func PrintOAuthTokenList(list *tfe.OAuthTokenList)
- func PrintRunList(list *tfe.RunList)
- func PrintSSHKeyList(list *tfe.SSHKeyList)
- func PrintVariableList(list *tfe.VariableList)
- func PrintWorkspaceList(list *tfe.WorkspaceList)
- func RemoveCredential(s []model.CredentialProfile, index int) []model.CredentialProfile
- func SetApplyFlags(cmd *cobra.Command)
- func SetConfigurationVersionFlags(cmd *cobra.Command)
- func SetConfigureFlags(cmd *cobra.Command)
- func SetOAuthClientFlags(cmd *cobra.Command)
- func SetOAuthTokenFlags(cmd *cobra.Command)
- func SetPlanFlags(cmd *cobra.Command)
- func SetRunFlags(cmd *cobra.Command)
- func SetVCSRepoFlags(cmd *cobra.Command)
- func SetVariableFlags(cmd *cobra.Command)
- func SetWorkspaceFlags(cmd *cobra.Command)
- func SetupLoggingLevel(level string) error
- func SetupLoggingOutput(path string) error
- func ToJSON(v interface{}) string
- func UpdateCredentialProfile(cmd *cobra.Command, cp model.CredentialProfile) model.CredentialProfile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAppDirAndFile ¶
func CheckAppDirAndFile() error
CheckAppDirAndFile checks if configuration directory and file exist
func DeleteConfigurationsDirectory ¶
func DeleteConfigurationsDirectory() error
DeleteConfigurationsDirectory delete the configurations directory
func FindVariableByKey ¶
func GetConfigurationVersionCreateOptions ¶
func GetConfigurationVersionCreateOptions(cmd *cobra.Command) tfe.ConfigurationVersionCreateOptions
GetConfigurationVersionCreateOptions return options based on the flags values
func GetCredentialProfileFlags ¶
func GetCredentialProfileFlags(cmd *cobra.Command) model.CredentialProfile
GetCredentialProfileFlags TODO ...
func GetOAuthClientCreateOptions ¶
func GetOAuthClientCreateOptions(cmd *cobra.Command) tfe.OAuthClientCreateOptions
GetOAuthClientCreateOptions return options based on the flags values
func GetOAuthTokenUpdateOptions ¶
func GetOAuthTokenUpdateOptions(cmd *cobra.Command) tfe.OAuthTokenUpdateOptions
GetOAuthTokenUpdateOptions return options based on the flag values
func GetRunApplyOptions ¶
func GetRunApplyOptions(cmd *cobra.Command) tfe.RunApplyOptions
GetRunApplyOptions return options based on the command's flags value
func GetRunCancelOptions ¶
func GetRunCancelOptions(cmd *cobra.Command) tfe.RunCancelOptions
GetRunCancelOptions return options based on the command's flags value
func GetRunCreateOptions ¶
func GetRunCreateOptions(cmd *cobra.Command) tfe.RunCreateOptions
GetRunCreateOptions return options based on the flags values
func GetRunDiscardOptions ¶
func GetRunDiscardOptions(cmd *cobra.Command) tfe.RunDiscardOptions
GetRunDiscardOptions return options based on the command's flags value
func GetRunForceCancelOptions ¶
func GetRunForceCancelOptions(cmd *cobra.Command) tfe.RunForceCancelOptions
GetRunForceCancelOptions return options based on the command's flags value
func GetRunReadOptions ¶
func GetRunReadOptions(cmd *cobra.Command) tfe.RunReadOptions
GetRunReadOptions return options based on the command's flags value
func GetSSHKeyByName ¶
func GetSSHKeyByName(list *tfe.SSHKeyList, name string) tfe.SSHKey
GetSSHKeyByName return SSHKey based on the given name
func GetSSHKeysCreateOptions ¶
func GetSSHKeysCreateOptions(cmd *cobra.Command) tfe.SSHKeyCreateOptions
GetSSHKeysCreateOptions return options based on the flags values
func GetSSHKeysUpdateOptions ¶
func GetSSHKeysUpdateOptions(cmd *cobra.Command) tfe.SSHKeyUpdateOptions
GetSSHKeysUpdateOptions return options based on the flag values
func GetSensitiveUserInput ¶
GetSensitiveUserInput get sensitive input as string
func GetSensitiveUserInputAsString ¶
GetSensitiveUserInputAsString get sensitive input as string
func GetTFEClient ¶
GetTFEClient returns a new terraform api client given a token
func GetUserInputAsBool ¶
GetUserInputAsBool prints `text` on console and return answer as `boolean`
func GetUserInputAsString ¶
GetUserInputAsString prints `text` on console and return answer as `string`
func GetVCSRepoFlags ¶
func GetVCSRepoFlags(cmd *cobra.Command) tfe.VCSRepoOptions
GetVCSRepoFlags define flags for the cobra command
func GetVariableCreateOptions ¶
func GetVariableCreateOptions(cmd *cobra.Command) tfe.VariableCreateOptions
GetVariableCreateOptions return tfe.VariableCreateOptions with correpondent values given by the flags
func GetVariableUpdateOptions ¶
func GetVariableUpdateOptions(cmd *cobra.Command) tfe.VariableUpdateOptions
GetVariableUpdateOptions return tfe.VariableUpdateOptions with correpondent values given by the flags
func GetWorkspaceAssignSSHKeyOptions ¶
func GetWorkspaceAssignSSHKeyOptions(cmd *cobra.Command) tfe.WorkspaceAssignSSHKeyOptions
GetWorkspaceAssignSSHKeyOptions return options based on the command's flags value
func GetWorkspaceCreateOptions ¶
func GetWorkspaceCreateOptions(cmd *cobra.Command) tfe.WorkspaceCreateOptions
GetWorkspaceCreateOptions return options based on the flags values
func GetWorkspaceListOptions ¶
func GetWorkspaceListOptions(cmd *cobra.Command) tfe.WorkspaceListOptions
GetWorkspaceListOptions TODO ...
func GetWorkspaceUpdateOptions ¶
func GetWorkspaceUpdateOptions(cmd *cobra.Command) tfe.WorkspaceUpdateOptions
GetWorkspaceUpdateOptions return options based on the flag values
func HasCreatedAppDir ¶
HasCreatedAppDir TODO ...
func PrintConfigurationVersionList ¶
func PrintConfigurationVersionList(list *tfe.ConfigurationVersionList)
PrintConfigurationVersionList TODO ...
func PrintOAuthClientList ¶
func PrintOAuthClientList(list *tfe.OAuthClientList)
PrintOAuthClientList TODO ...
func PrintOAuthTokenList ¶
func PrintOAuthTokenList(list *tfe.OAuthTokenList)
PrintOAuthTokenList TODO ...
func PrintVariableList ¶
func PrintVariableList(list *tfe.VariableList)
PrintVariableList convert struct to JSON and displays to user
func PrintWorkspaceList ¶
func PrintWorkspaceList(list *tfe.WorkspaceList)
PrintWorkspaceList TODO ...
func RemoveCredential ¶
func RemoveCredential(s []model.CredentialProfile, index int) []model.CredentialProfile
RemoveCredential TODO ...
func SetApplyFlags ¶
SetApplyFlags define flags for the cobra command
func SetConfigurationVersionFlags ¶
SetConfigurationVersionFlags define flags for the cobra command
func SetOAuthClientFlags ¶
SetOAuthClientFlags define flags for the cobra command
func SetOAuthTokenFlags ¶
SetOAuthTokenFlags define flags for the cobra command
func SetPlanFlags ¶
SetPlanFlags define flags for the cobra command
func SetRunFlags ¶
SetRunFlags define flags for the cobra command
func SetVCSRepoFlags ¶
SetVCSRepoFlags define flags for the cobra command ..
func SetVariableFlags ¶
SetVariableFlags define flags for the cobra command
func SetWorkspaceFlags ¶
SetWorkspaceFlags define flags for the cobra command
func SetupLoggingLevel ¶
SetupLoggingLevel set logrus level
func SetupLoggingOutput ¶
SetupLoggingOutput set logrun output file
func UpdateCredentialProfile ¶
func UpdateCredentialProfile(cmd *cobra.Command, cp model.CredentialProfile) model.CredentialProfile
UpdateCredentialProfile update credential profile based on input flags
Types ¶
This section is empty.