util

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureCommands

func EnsureCommands(names ...string) error

EnsureCommands ensures the given commands are available

func EnsureEnvVars

func EnsureEnvVars(names ...string) error

EnsureEnvVars ensures the given environment variables are set

Types

type HTTPError

type HTTPError struct {
	Request    *http.Request
	StatusCode int
	Body       string
}

HTTPError is an error for http requests

func NewHTTPError

func NewHTTPError(res *http.Response) *HTTPError

NewHTTPError creates a new instance of HTTPError

func (*HTTPError) Error

func (e *HTTPError) Error() string

type HTTPResult

type HTTPResult struct {
	Res *http.Response
	Err error
}

HTTPResult is the result of an http request

type ResetFunc

type ResetFunc func() error

ResetFunc is the type for a reset function

func SetEnvVars

func SetEnvVars(keyVals ...string) (ResetFunc, error)

SetEnvVars set a set of environment variables and returns a reset function for restoring them

Jump to

Keyboard shortcuts

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