getter

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client to retrieve sources

func New

func New(options *Options) *Client

New creates a new getter client. It configures all the detectors and getters itself to make sure they are configured correctly.

func (*Client) Detect

func (c *Client) Detect(src string) (string, error)

Detect is a wrapper on go-getter detect and will return the location for source

func (*Client) Get

func (c *Client) Get(src, dst string, version *string) error

Get retrieves sources from src and load them into dst

type LocalGetter

type LocalGetter struct {
	getter.FileGetter
}

LocalGetter is a wrapper around the go-getter implementation of FileGetter This is due to the go-getter implementation does not support copying a local directory, it will only create a symlink. That causes some problems for modules that should be copied into temp folder

func (*LocalGetter) Get

func (g *LocalGetter) Get(dst string, u *url.URL) error

Get overwrites FileGetter.Get if Copy is set to true. Otherwise it will just call the FileGetter.Get function and use standard functionallity

func (*LocalGetter) GetFile

func (g *LocalGetter) GetFile(dst string, u *url.URL) error

GetFile just wraps the FileGetter function

type Options

type Options struct {
	HttpClient       *http.Client //nolint:golint
	WorkingDirectory string
}

Options for initialization

type RegistryDetector

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

RegistryDetector implements detector to detect terraform registry Src have to be formatted with query parameter ?registryVersion= avinor/storage-account/azurerm?registryVersion=1.0

func (*RegistryDetector) Detect

func (d *RegistryDetector) Detect(src, _ string) (string, bool, error)

Detect implements the Detector interface and will check if this source is a terraform registry source. If src contains ?registryVersion parameter it will assume it is a registry source.

func (*RegistryDetector) DetectRegistry

func (d *RegistryDetector) DetectRegistry(src string) (string, bool, error)

DetectRegistry tries to locate the download location for terraform registry source

Jump to

Keyboard shortcuts

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