rest

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2019 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FileUrlTemplate string = "{{.RemoteRepo}}/{{.FileName}}"

var RemoteRepo string = "https://github.com/datacharmer/mysql-docker-minimal/blob/master/dbdata" var RemoteRepoRaw string = "https://raw.githubusercontent.com/datacharmer/mysql-docker-minimal/master/dbdata"

View Source
var IndexUrlTemplate string = "{{.RemoteRepo}}/{{.FileName}}"

Functions

func DownloadFile

func DownloadFile(filepath string, url string, progress bool, progressStep int64) error

DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory.

func FileUrl

func FileUrl(fileName string) string

func IndexUrl

func IndexUrl() string

Types

type PassThru added in v1.31.0

type PassThru struct {
	io.Reader
	// contains filtered or unexported fields
}

func (*PassThru) Read added in v1.31.0

func (pt *PassThru) Read(p []byte) (int, error)

Read 'overrides' the underlying io.Reader's Read method. This is the one that will be called by io.Copy(). We simply use it to keep track of byte counts and then forward the call.

type RemoteFilesMap

type RemoteFilesMap = map[string][]string

func GetRemoteIndex

func GetRemoteIndex() (index RemoteFilesMap, err error)

Jump to

Keyboard shortcuts

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