download

package
v0.2.1-0...-3b06ce0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetVersion

func SetVersion(v string)

SetVersion sets the application version for use in HTTP request header.

Types

type Downloader

type Downloader interface {
	Download(url string) (string, error)
}

Downloader retrieves a template from an URL.

type Getter

type Getter interface {
	Get(url string) (*bytes.Buffer, error)
}

Getter is an interface to support GET to the specified URL.

type HTTPGetter

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

HTTPGetter is the default HTTP backend handler.

func NewHTTPGetter

func NewHTTPGetter() *HTTPGetter

NewHTTPGetter constructs a valid HTTP client as HttpGetter.

func (*HTTPGetter) Get

func (g *HTTPGetter) Get(href string) (*bytes.Buffer, error)

Get performs a Get from repo.Getter and returns the body.

type TemplateDownloader

type TemplateDownloader struct {
	Home   storage.Home
	Getter Getter
}

TemplateDownloader retrieves a template archive from an URL.

func (*TemplateDownloader) Download

func (td *TemplateDownloader) Download(url string) (string, error)

Download downloads a template archive from an URL.

Jump to

Keyboard shortcuts

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