utils

package
v0.3.27 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskForConfirmation

func AskForConfirmation() bool

AskForConfirmation prompts user for yes/no response

func Assert

func Assert(err error)

Assert asserts there was no error, else log.Fatal

func CopyFile

func CopyFile(dst, src string) error

CopyFile copies file from dst to scr

func GetHashType

func GetHashType(hash string) (string, error)

GetHashType returns the hash type (md5, sha1, sha256, sha512)

func GetOpt

func GetOpt(name, dfault string) string

GetOpt returns Env var or default

func GetSHA256

func GetSHA256(name string) string

GetSHA256 calculates a file's sha256sum

func Getopt

func Getopt(name, dfault string) string

Getopt reads environment variables. If not found will return a supplied default value

func ParseJSON

func ParseJSON(data []byte, path string) (out string)

ParseJSON returns a JSON value for a given key NOTE: https://godoc.org/github.com/dustin/go-jsonpointer

func ParseMail

func ParseMail(r *http.Request) (email.Email, error)

ParseMail takes in an HTTP Request and returns an Email object TODO: This function will likely be changed to take in a []byte

func RemoveDuplicates

func RemoveDuplicates(elements []string) []string

RemoveDuplicates removes duplicate items from a list

func RunCommand

func RunCommand(cmd string, args ...string) string

RunCommand runs cmd on file

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice returns whether or not a string exists in a slice

Types

This section is empty.

Directories

Path Synopsis
Package clitable implements methods for pretty command line table output.
Package clitable implements methods for pretty command line table output.

Jump to

Keyboard shortcuts

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