rest

package
v1.73.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: Apache-2.0 Imports: 11 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 DownloadFileWithRetry added in v1.68.0

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

DownloadFileWithRetry 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 DbdeployerRelease added in v1.36.0

type DbdeployerRelease struct {
	Assets []struct {
		BrowserDownloadURL string      `json:"browser_download_url"`
		ContentType        string      `json:"content_type"`
		CreatedAt          string      `json:"created_at"`
		DownloadCount      int64       `json:"download_count"`
		Name               string      `json:"name"`
		Size               int64       `json:"size"`
		State              string      `json:"state"`
		Uploader           ReleaseUser `json:"uploader"`
		URL                string      `json:"url"`
	} `json:"assets"`
	Author          ReleaseUser `json:"author"`
	Body            string      `json:"body"`
	CreatedAt       string      `json:"created_at"`
	Draft           bool        `json:"draft"`
	HTMLURL         string      `json:"html_url"`
	Name            string      `json:"name"`
	Prerelease      bool        `json:"prerelease"`
	PublishedAt     string      `json:"published_at"`
	TagName         string      `json:"tag_name"`
	TarballURL      string      `json:"tarball_url"`
	TargetCommitish string      `json:"target_commitish"`
	ZipballURL      string      `json:"zipball_url"`
}

func GetLatestRelease added in v1.36.0

func GetLatestRelease(tag string) (DbdeployerRelease, error)

func GetReleases added in v1.36.0

func GetReleases() ([]DbdeployerRelease, error)

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 ReleaseUser added in v1.36.0

type ReleaseUser struct {
	Login string `json:"login"`
	Type  string `json:"type"`
	URL   string `json:"url"`
}

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