|
|
|
|
@ -102,6 +102,23 @@ In the absense of a forced protocol, detectors may be run on the URL, transformi
|
|
|
|
|
the protocol anyways. The above example would've used the Git protocol either
|
|
|
|
|
way since the Git detector would've detected it was a GitHub URL.
|
|
|
|
|
|
|
|
|
|
### Protocol-Specific Options
|
|
|
|
|
|
|
|
|
|
Each protocol can support protocol-specific options to configure that
|
|
|
|
|
protocol. For example, the `git` protocol supports specifying a `ref`
|
|
|
|
|
query parameter that tells it what ref to checkout for that Git
|
|
|
|
|
repository.
|
|
|
|
|
|
|
|
|
|
The options are specified as query parameters on the URL (or URL-like string)
|
|
|
|
|
given to go-getter. Using the Git example above, the URL below is a valid
|
|
|
|
|
input to go-getter:
|
|
|
|
|
|
|
|
|
|
github.com/hashicorp/go-getter?ref=abcd1234
|
|
|
|
|
|
|
|
|
|
The protocol-specific options are documented below the URL format
|
|
|
|
|
section. But because they are part of the URL, we point it out here so
|
|
|
|
|
you know they exist.
|
|
|
|
|
|
|
|
|
|
### Checksumming
|
|
|
|
|
|
|
|
|
|
For file downloads of any protocol, go-getter can automatically verify
|
|
|
|
|
@ -163,3 +180,68 @@ And finally, you can disable archiving completely:
|
|
|
|
|
You can combine unarchiving with the other features of go-getter such
|
|
|
|
|
as checksumming. The special `archive` query parameter will be removed
|
|
|
|
|
from the URL before going to the final protocol downloader.
|
|
|
|
|
|
|
|
|
|
## Protocol-Specific Options
|
|
|
|
|
|
|
|
|
|
This section documents the protocol-specific options that can be specified
|
|
|
|
|
for go-getter. These options should be appended to the input as normal query
|
|
|
|
|
parameters. Depending on the usage of go-getter, applications may provide
|
|
|
|
|
alternate ways of inputting options. For example, [Nomad](https://www.nomadproject.io)
|
|
|
|
|
provides a nice options block for specifying options rather than in the URL.
|
|
|
|
|
|
|
|
|
|
## General (All Protocols)
|
|
|
|
|
|
|
|
|
|
The options below are available to all protocols:
|
|
|
|
|
|
|
|
|
|
* `archive` - The archive format to use to unarchive this file, or "" (empty
|
|
|
|
|
string) to disable unarchiving. For more details, see the complete section
|
|
|
|
|
on archive support above.
|
|
|
|
|
|
|
|
|
|
* `checksum` - Checksum to verify the downloaded file or archive. See
|
|
|
|
|
the entire section on checksumming above for format and more details.
|
|
|
|
|
|
|
|
|
|
### Local Files (`file`)
|
|
|
|
|
|
|
|
|
|
None
|
|
|
|
|
|
|
|
|
|
### Git (`git`)
|
|
|
|
|
|
|
|
|
|
* `ref` - The Git ref to checkout. This is a ref, so it can point to
|
|
|
|
|
a commit SHA, a branch name, etc. If it is a named ref such as a branch
|
|
|
|
|
name, go-getter will update it to the latest on each get.
|
|
|
|
|
|
|
|
|
|
### Mercurial (`hg`)
|
|
|
|
|
|
|
|
|
|
* `rev` - The Mercurial revision to checkout.
|
|
|
|
|
|
|
|
|
|
### HTTP (`http`)
|
|
|
|
|
|
|
|
|
|
None
|
|
|
|
|
|
|
|
|
|
### S3 (`s3`)
|
|
|
|
|
|
|
|
|
|
S3 takes various access configurations in the URL. Note that it will also
|
|
|
|
|
read these from standard AWS environment variables if they're set. If
|
|
|
|
|
the query parameters are present, these take priority.
|
|
|
|
|
|
|
|
|
|
* `aws_access_key_id` - AWS access key.
|
|
|
|
|
* `aws_access_key_secret` - AWS access key secret.
|
|
|
|
|
* `aws_access_token` - AWS access token if this is being used.
|
|
|
|
|
|
|
|
|
|
#### Using IAM Instance Profiles with S3
|
|
|
|
|
|
|
|
|
|
If you use go-getter and want to use an EC2 IAM Instance Profile to avoid
|
|
|
|
|
using credentials, then just omit these and the profile, if available will
|
|
|
|
|
be used automatically.
|
|
|
|
|
|
|
|
|
|
#### S3 Bucket Examples
|
|
|
|
|
|
|
|
|
|
S3 has several addressing schemes used to reference your bucket. These are
|
|
|
|
|
listed here: http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro
|
|
|
|
|
|
|
|
|
|
Some examples for these addressing schemes:
|
|
|
|
|
- s3::https://s3.amazonaws.com/bucket/foo
|
|
|
|
|
- s3::https://s3-eu-west-1.amazonaws.com/bucket/foo
|
|
|
|
|
- bucket.s3.amazonaws.com/foo
|
|
|
|
|
- bucket.s3-eu-west-1.amazonaws.com/foo/bar
|
|
|
|
|
|
|
|
|
|
|