utils

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: GPL-3.0 Imports: 14 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskConfirmation

func AskConfirmation(question string, optimistic bool) (bool, error)

AskConfirmation prompts for user input to confirm a choice

func CopyDir added in v0.2.0

func CopyDir(src, dest string) error

CopyDir copies a directory from src to dest, recursively copying nested directories

func CopyFile added in v0.2.0

func CopyFile(src, dest string) error

CopyFile copies a file from the src to dest

func DoAuthorizedReq added in v0.4.9

func DoAuthorizedReq(ctx infra.DnoteCtx, hc http.Client, method, path, body string) (*http.Response, error)

DoAuthorizedReq does a http request to the given path in the api endpoint as a user, with the appropriate headers. The given path should include the preceding slash.

func DoReq added in v0.6.0

func DoReq(ctx infra.DnoteCtx, method, path, body string) (*http.Response, error)

DoReq does a http request to the given path in the api endpoint

func FileExists added in v0.2.0

func FileExists(filepath string) bool

FileExists checks if the file exists at the given path

func GenerateUUID added in v0.4.5

func GenerateUUID() string

GenerateUUID returns a uid

func PromptInput added in v0.6.0

func PromptInput(message string, dest *string) error

PromptInput prompts the user input and saves the result to the destination

func PromptPassword added in v0.6.0

func PromptPassword(message string, dest *string) error

PromptPassword prompts the user input a password and saves the result to the destination. The input is masked, meaning it is not echoed on the terminal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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