Documentation
¶
Overview ¶
Package getter is used to download or copy source files from remote / local location. It is a wrapper around go-getter and supports all the same features. It also implements a special detector for terraform registry support. This allows it to use the official terraform registry to download modules.
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 used to download or copy source files with. Support all features that go-getter supports, local files, http, git etc.
func New ¶
New creates a new getter client. It configures all the detectors and getters itself to make sure they are configured correctly.
func (*Client) Clone ¶
Clone creates a clone of the client with an alternative new working directory. If workingDir is set to "" it will just reuse same directory in client
func (*Client) Detect ¶
Detect is a wrapper on go-getter detect and will return a new source string that is the parsed url using correct getter
func (*Client) Get ¶
Get retrieves sources from src and load them into dst folder. If version is set it will try to download from terraform registry. Set to nil to disable this feature.
func (*Client) GetFile ¶
GetFile retrieves a single file from src destination. It implements almost same functionallity that Get function, but does only allow a single file to be downloaded. Since terraform registry does not supply single files it cannot download any single files from terraform registry.
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
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