Documentation ¶
Index ¶
- Constants
- func BodyAsString(resp *http.Response) (string, error)
- func CallExternalNoStdOut(additionalEnv []string, cwd string, executable string, args ...string) (int, error)
- func CallExternalStdOut(additionalEnv []string, cwd string, executable string, args ...string) (int, error)
- func CallExternalWithOutput(additionalEnv []string, cwd string, executable string, args ...string) (int, string, error)
- func ContextualHelpError(err error, suggestions ...string) error
- func CopyLocalFile(src string, dest string, showProgress bool) error
- func DownloadFile(fileUrlOrPath string, dest string, showProgress bool) error
- func DownloadFileFromUrl(url string, dest string, showProgress bool) error
- func GetAuthToken() (string, error)
- func GetPassword() (string, error)
- func GetSecret(key string) (string, error)
- func GetUsername() (string, error)
- func HasDebugFlag(name string) bool
- func Hash(s string) uint32
- func HttpDoWithBasicAuth(method, url, user, password string, input io.Reader) (int, []byte, error)
- func HttpEtag(url string) (int, string, error)
- func HttpGet(url string) (int, []byte, error)
- func HttpGetWithBasicAuth(url, user, password string) (int, []byte, error)
- func HttpGetWrapper(url string) (*http.Response, error)
- func HttpNewRequestWrapper(method, url string, body io.Reader) (*http.Request, error)
- func HttpPostInputWithBasicAuth(url, user, password string, input io.Reader) (int, []byte, error)
- func HttpPostWithBasicAuth(url, user, password string) (int, []byte, error)
- func Is2xx(statusCode int) bool
- func IsAbsolutePath(pathname string) bool
- func LoadFile(fileUrlOrPath string) ([]byte, error)
- func LoadFileFromUrl(url string) ([]byte, error)
- func ReadPassword() ([]byte, error)
- func ResolveUrl(url string) (string, bool)
- func SetPassword(value string) error
- func SetSecret(key string, value string) error
- func SetUsername(value string) error
- func TestCommand(cmd *cobra.Command, args ...string) (string, error)
- type DebugFlags
Constants ¶
const ( FORCE_SELF_UPDATE = "force_self_update" NO_MERGE_STATUS_CHECK = "no_merge_status_check" SHOW_CMD_EXEC_STDOUT = "show_cmd_exec_stdout" USE_FILE_VAULT = "use_file_vault" )
Variables ¶
This section is empty.
Functions ¶
func CallExternalNoStdOut ¶
func CallExternalNoStdOut(additionalEnv []string, cwd string, executable string, args ...string) (int, error)
Call external command without output to standard out/err
func CallExternalStdOut ¶
func CallExternalStdOut(additionalEnv []string, cwd string, executable string, args ...string) (int, error)
Call external command and output to standard out/err
func CallExternalWithOutput ¶
func CallExternalWithOutput(additionalEnv []string, cwd string, executable string, args ...string) (int, string, error)
Call external command and return the output string
func ContextualHelpError ¶
A contextual help error not only provides the error message, but also a suggestion for user to correct them in the next command
for example, when command fails to find necessary files in the workspace, an actionable error will be helpful to remind the user double check the workspace, or specify a different one with dedicated flag
func DownloadFile ¶
Download file from http(s) or local disk Use http:// https:// as prefix for remote file Use file:// or no prefix for local file
func DownloadFileFromUrl ¶
func GetAuthToken ¶
func GetPassword ¶
func GetUsername ¶
func HttpDoWithBasicAuth ¶
func HttpGetWithBasicAuth ¶
func HttpNewRequestWrapper ¶
func HttpPostWithBasicAuth ¶
func IsAbsolutePath ¶
Check if the path is an absolute path
The standard go function does not support Windows :(
func LoadFile ¶
Load file from http(s) or local disk Use http:// https:// as prefix for remote file Use file:// or no prefix for local file
func LoadFileFromUrl ¶
Load a file from a http(s) url
func ReadPassword ¶
func ResolveUrl ¶
func SetPassword ¶
func SetUsername ¶
Types ¶
type DebugFlags ¶
type DebugFlags struct { ForceSelfUpdate bool // Force the self update of the CDT NoMergeStatusCheck bool // do not check merge status when querying merged changes in gerrit ShowCmdExecStdout bool // always show cmd exec stdout to console UseFileVault bool // use file vault instead of system vault }