aid

package
v0.0.0-...-59f78f7 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

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

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 FindVariableByKey(list *tfe.VariableList, cmd *cobra.Command) (*tfe.Variable, error)

func GetAppInfo

func GetAppInfo() model.App

GetAppInfo return information about tecli settings

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

func GetSensitiveUserInput(cmd *cobra.Command, text string, info string) (string, error)

GetSensitiveUserInput get sensitive input as string

func GetSensitiveUserInputAsString

func GetSensitiveUserInputAsString(cmd *cobra.Command, text string, info string) string

GetSensitiveUserInputAsString get sensitive input as string

func GetTFEClient

func GetTFEClient(token string) *tfe.Client

GetTFEClient returns a new terraform api client given a token

func GetUserInputAsBool

func GetUserInputAsBool(cmd *cobra.Command, text string, info bool) bool

GetUserInputAsBool prints `text` on console and return answer as `boolean`

func GetUserInputAsString

func GetUserInputAsString(cmd *cobra.Command, text string, info string) string

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

func HasCreatedAppDir(cmd *cobra.Command) (bool, error)

HasCreatedAppDir TODO ...

func LoadViper

func LoadViper()

LoadViper setup project setting

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 PrintRunList

func PrintRunList(list *tfe.RunList)

PrintRunList TODO ...

func PrintSSHKeyList

func PrintSSHKeyList(list *tfe.SSHKeyList)

PrintSSHKeyList 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

func SetApplyFlags(cmd *cobra.Command)

SetApplyFlags define flags for the cobra command

func SetConfigurationVersionFlags

func SetConfigurationVersionFlags(cmd *cobra.Command)

SetConfigurationVersionFlags define flags for the cobra command

func SetConfigureFlags

func SetConfigureFlags(cmd *cobra.Command)

SetConfigureFlags TODO ...

func SetOAuthClientFlags

func SetOAuthClientFlags(cmd *cobra.Command)

SetOAuthClientFlags define flags for the cobra command

func SetOAuthTokenFlags

func SetOAuthTokenFlags(cmd *cobra.Command)

SetOAuthTokenFlags define flags for the cobra command

func SetPlanFlags

func SetPlanFlags(cmd *cobra.Command)

SetPlanFlags define flags for the cobra command

func SetRunFlags

func SetRunFlags(cmd *cobra.Command)

SetRunFlags define flags for the cobra command

func SetVCSRepoFlags

func SetVCSRepoFlags(cmd *cobra.Command)

SetVCSRepoFlags define flags for the cobra command ..

func SetVariableFlags

func SetVariableFlags(cmd *cobra.Command)

SetVariableFlags define flags for the cobra command

func SetWorkspaceFlags

func SetWorkspaceFlags(cmd *cobra.Command)

SetWorkspaceFlags define flags for the cobra command

func SetupLoggingLevel

func SetupLoggingLevel(level string) error

SetupLoggingLevel set logrus level

func SetupLoggingOutput

func SetupLoggingOutput(path string) error

SetupLoggingOutput set logrun output file

func ToJSON

func ToJSON(v interface{}) string

ToJSON converts a given struct to json

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.

Jump to

Keyboard shortcuts

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