util

package
v0.0.0-...-264c13e Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfirmationPrompt

func ConfirmationPrompt(action string) bool

ConfirmationPrompt is a utility function, used to prompt the user for confirmation on potentially dangerous commands. Returns true if the user types yes and false if they don't.

func DeleteFromSlice

func DeleteFromSlice(slice []string, index int) []string

DeleteFromSlice is a utility function to remove an object from a slice at the provided index.

func ExtractCredentialsFromAuthorizationHeader

func ExtractCredentialsFromAuthorizationHeader(authorizationHeader string) (string, string, error)

ExtractCredentialsFromAuthorizationHeader takes a Basic Authorization header and decodes it to return the username and passowrd

func ExtractUsernameFromAuthorizationHeader

func ExtractUsernameFromAuthorizationHeader(authorizationHeader string) (string, error)

ExtractUsernameFromAuthorizationHeader takes a Basic Authorization header and decodes it to return the username

func ReadPassword

func ReadPassword() (string, error)

ReadPassword is a utility function, used to read passwords securely from the terminal.

func ReadUsername

func ReadUsername() (string, error)

ReadUsername is a utility function, used to read usernames from 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