Documentation ¶
Overview ¶
Inspired by similar approach in: https://github.com/helm/helm (Apache 2.0 License).
Inspired by similar approach in: https://github.com/helm/helm (Apache 2.0 License).
Index ¶
- type Constructor
- type Getter
- type HTTPGetter
- type Option
- func WithBasicAuth(username, password string) Option
- func WithInsecureSkipVerifyTLS(insecureSkipVerifyTLS bool) Option
- func WithTLSClientConfig(certFile, keyFile, caFile string) Option
- func WithTimeout(timeout time.Duration) Option
- func WithURL(url string) Option
- func WithUserAgent(userAgent string) Option
- type Provider
- type Providers
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 Getter ¶
type Getter interface { // Get file content by url string Get(ctx context.Context, 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.
type HTTPGetter ¶
type HTTPGetter struct {
// contains filtered or unexported fields
}
HTTPGetter 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 ¶
WithInsecureSkipVerifyTLS determines if a TLS Certificate will be checked.
func WithTLSClientConfig ¶
WithTLSClientConfig sets the client auth with the provided credentials.
func WithTimeout ¶
WithTimeout sets the timeout for requests.
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.