utils

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DigestVerify

func DigestVerify(path, digest string) error

func HashString

func HashString(input string) string

func PathExists

func PathExists(path string) bool

func PathExpand

func PathExpand(path string) string

func PathSimplify

func PathSimplify(path string) string

func UrlIsRemote

func UrlIsRemote(url string) bool

func UrlJoin added in v0.3.0

func UrlJoin(base string, elems ...string) string

Types

type DownloadableFile added in v0.3.0

type DownloadableFile struct {
	Url            string
	Digest         string
	ExtractPattern string // must be set to extract archives
}

func (DownloadableFile) Open added in v0.3.0

func (d DownloadableFile) Open() (io.ReadCloser, error)

func (DownloadableFile) ReadAll added in v0.3.0

func (d DownloadableFile) ReadAll() ([]byte, error)

func (DownloadableFile) ReadAllWithCache added in v0.3.0

func (d DownloadableFile) ReadAllWithCache(cacheDir string, refresh time.Duration) ([]byte, time.Time, error)

func (DownloadableFile) SaveTo added in v0.3.0

func (d DownloadableFile) SaveTo(path string) error

type VolatileTempFile

type VolatileTempFile struct {
	// contains filtered or unexported fields
}

func (VolatileTempFile) Close

func (f VolatileTempFile) Close() error

func (VolatileTempFile) Read

func (f VolatileTempFile) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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