utils

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: EPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(c io.Closer)

Types

type HTTPError

type HTTPError struct {
	StatusCode int
	Body       string
	// contains filtered or unexported fields
}

func NewHTTPError

func NewHTTPError(resp *http.Response, errMsg string) *HTTPError

func (*HTTPError) Error

func (e *HTTPError) Error() string

type IoUtil

type IoUtil interface {
	Download(URL string, destPath string, useContentDisposition bool) (string, error)
	CopyResource(src string, dest string) error
	CopyFile(src string, dest string) error
	ResolveDestPath(filePath string, destDir string) string
	ResolveDestPathFromURL(url string, destDir string) string
	TempDir(string, string) (string, error)
	MkDir(string) error
	Unzip(arch string, dest string) error
	Untar(tarPath string, dest string) error
	CreateFile(file string, tr io.Reader) error
	Fetch(url string) ([]byte, error)
}

func New

func New() IoUtil

New creates an instance of IoUtil using the default http client.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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