util

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFile added in v0.2.19

func CreateFile(filename string, directoryPerm, filePerm fs.FileMode) error

CreateFile safely creates an empty file and any missing directory structure. The directories will have directoryPerm filemode. The file will have filePerm filemode.

func FileExists

func FileExists(path string) bool

func FirstRunPrompt added in v0.1.15

func FirstRunPrompt() error

FirstRunPrompt gets user input to bootstrap a bare-minimum configuration.

func OpenLink(link string) error

Attempt to open a link in browser, if supported

func PromptBool added in v0.1.15

func PromptBool(label string) (bool, error)

func PromptFilePath added in v0.1.15

func PromptFilePath(label, defaultValue string) (string, error)

func PromptFilePathNoValidate added in v0.1.15

func PromptFilePathNoValidate(label, defaultValue string) (string, error)

func PromptString added in v0.1.15

func PromptString(label string) (string, error)

func WriteError added in v0.1.16

func WriteError(w http.ResponseWriter, message string, status int)

WriteError writes a status code and plaintext error to the provided http.ResponseWriter. The error is written as plaintext so AWS SDKs will display it inline with an error message.

Types

type AwsArn

type AwsArn struct {
	Arn               string
	Partition         string
	Service           string
	Region            string
	AccountId         string
	ResourceType      string
	Resource          string
	ResourceDelimiter string
}

func ArnParse

func ArnParse(arn string) (*AwsArn, error)

func (AwsArn) ArnString

func (a AwsArn) ArnString() string

type ErrorResponse added in v0.1.16

type ErrorResponse struct {
	Message string `json:"message"`
	Code    string `json:"code"`
}

Jump to

Keyboard shortcuts

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