getter

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Constructor

type Constructor func(options ...Option) (Getter, error)

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(url string, options ...Option) (*bytes.Buffer, error)
}

Getter gets stuff

func NewHTTPGetter

func NewHTTPGetter(options ...Option) (Getter, error)

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

func (*HTTPGetter) Get

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

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

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 WithContextx

func WithContextx(ctx context.Context) Option

func WithRegistryClient

func WithRegistryClient(client *sdkman.RegistryService) Option

func WithTagName

func WithTagName(tagname string) Option

func WithURL

func WithURL(url string) Option

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 WithUntar

func WithUntar() Option

type Provider

type Provider struct {
	Schemes []string
	New     Constructor
}

func (Provider) Provides

func (p Provider) Provides(scheme string) bool

Provides returns true if the given scheme is supported by this Provider.

type Providers

type Providers []Provider

func All

func All() 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. func All(settings *cli.Env) Providers {

func (Providers) ByScheme

func (p Providers) ByScheme(scheme string) (Getter, error)

ByScheme returns a Provider that handles the given scheme.

If no provider handles this scheme, this will return an error.

Jump to

Keyboard shortcuts

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