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
- type Constructor
- type Getter
- type HTTPGetter
- type OCIGetter
- type Option
- func WithBasicAuth(username, password string) Option
- func WithInsecureSkipVerifyTLS(insecureSkipVerifyTLS bool) Option
- func WithPassCredentialsAll(pass bool) Option
- func WithPlainHTTP(plainHTTP bool) Option
- func WithRegistryClient(client *registry.Client) Option
- func WithTLSClientConfig(certFile, keyFile, caFile string) Option
- func WithTagName(tagname string) Option
- func WithTimeout(timeout time.Duration) Option
- func WithTransport(transport *http.Transport) Option
- func WithURL(url string) Option
- func WithUntar() Option
- func WithUserAgent(userAgent string) Option
- type Provider
- type Providers
Constants ¶
const ( // The cost timeout references curl's default connection timeout. // https://github.com/curl/curl/blob/master/lib/connect.h#L40C21-L40C21 // The helm commands are usually executed manually. Considering the acceptable waiting time, we reduced the entire request time to 120s. DefaultHTTPTimeout = 120 )
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
func NewPluginGetter ¶
func NewPluginGetter(command string, settings *cli.EnvSettings, name, base string) Constructor
NewPluginGetter constructs a valid plugin getter
type Getter ¶
type Getter interface { // Get file content by url string Get(url string, options ...Option) (*bytes.Buffer, error) }
Getter is an interface to support GET to the specified URL.
func NewHTTPGetter ¶
NewHTTPGetter constructs a valid http/https client as a Getter
func NewOCIGetter ¶ added in v3.5.0
NewOCIGetter constructs a valid http/https client as a Getter
type HTTPGetter ¶
type HTTPGetter struct {
// contains filtered or unexported fields
}
HTTPGetter is the default HTTP(/S) backend handler
type OCIGetter ¶ added in v3.5.0
type OCIGetter struct {
// contains filtered or unexported fields
}
OCIGetter is the default HTTP(/S) backend handler
type Option ¶
type Option func(*options)
Option allows specifying various settings configurable by the user for overriding the defaults used when performing Get operations with the Getter.
func WithBasicAuth ¶
WithBasicAuth sets the request's Authorization header to use the provided credentials
func WithInsecureSkipVerifyTLS ¶ added in v3.2.0
WithInsecureSkipVerifyTLS determines if a TLS Certificate will be checked
func WithPassCredentialsAll ¶ added in v3.6.1
func WithPlainHTTP ¶ added in v3.13.0
func WithRegistryClient ¶ added in v3.5.0
func WithTLSClientConfig ¶
WithTLSClientConfig sets the client auth with the provided credentials.
func WithTagName ¶ added in v3.5.0
func WithTimeout ¶ added in v3.3.0
WithTimeout sets the timeout for requests
func WithTransport ¶ added in v3.8.2
WithTransport sets the http.Transport to allow overwriting the HTTPGetter default.
func WithURL ¶
WithURL informs the getter the server name that will be used when fetching objects. Used in conjunction with WithTLSClientConfig to set the TLSClientConfig's server name.
func WithUserAgent ¶
WithUserAgent sets the request's User-Agent header to use the provided agent name.
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 built-in getters and the discovered plugins with downloader notations are collected.