Documentation ¶
Overview ¶
Package getter provides a generalize tool for fetching data by scheme.
This provides a method by which the plugin system can load arbitrary protocol handlers based upon a URL scheme.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Constructor ¶
Constructor is the function for every getter which creates a specific instance according to the configuration
type HTTPGetter ¶
type HTTPGetter struct {
// contains filtered or unexported fields
}
HTTPGetter is the efault HTTP(/S) backend handler
func NewHTTPGetter ¶
func NewHTTPGetter(URL, CertFile, KeyFile, CAFile string) (*HTTPGetter, error)
NewHTTPGetter constructs a valid http/https 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.
func (*HTTPGetter) SetCredentials ¶
func (g *HTTPGetter) SetCredentials(username, password string)
SetCredentials sets the credentials for the getter
func (*HTTPGetter) SetUserAgent ¶
func (g *HTTPGetter) SetUserAgent(userAgent string)
SetUserAgent sets the HTTP User-Agent for the getter
type Provider ¶
type Provider struct { Schemes []string New Constructor }
Provider represents any getter and the schemes that it supports.
For example, an HTTP provider may provide one getter that handles both 'http' and 'https' schemes.
type Providers ¶
type Providers []Provider
Providers is a collection of Provider objects.
func All ¶
func All(settings cli.EnvSettings) Providers
All finds all of the registered getters as a list of Provider instances. Currently the build-in http/https getter and the discovered plugins with downloader notations are collected.