config

package
v0.0.0-...-73df0bb Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2018 License: Apache-2.0, Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const EmptyRegion = " "

EmptyRegion is required to allow us to use the AWS SDK against S3 compatible blobstores which do not have the concept of a region

View Source
const NoneCredentialsSource = "none"

NoneCredentialsSource specifies that credentials will be empty. The blobstore client operates in read only mode.

View Source
const StaticCredentialsSource = "static"

StaticCredentialsSource specifies that credentials will be supplied using access_key_id and secret_access_key

Variables

View Source
var AWSHostToRegion = map[string]string{
	"s3.amazonaws.com":            "us-east-1",
	"s3-external-1.amazonaws.com": "us-east-1",

	"s3.us-east-2.amazonaws.com": "us-east-2",
	"s3-us-east-2.amazonaws.com": "us-east-2",

	"s3-us-west-1.amazonaws.com": "us-west-1",
	"s3-us-west-2.amazonaws.com": "us-west-2",

	"s3.ca-central-1.amazonaws.com": "ca-central-1",
	"s3-ca-central-1.amazonaws.com": "ca-central-1",

	"s3-eu-west-1.amazonaws.com": "eu-west-1",
	"s3-eu-west-2.amazonaws.com": "eu-west-2",

	"s3.eu-central-1.amazonaws.com": "eu-central-1",
	"s3-eu-central-1.amazonaws.com": "eu-central-1",

	"s3.ap-south-1.amazonaws.com": "ap-south-1",
	"s3-ap-south-1.amazonaws.com": "ap-south-1",

	"s3-ap-southeast-1.amazonaws.com": "ap-southeast-1",
	"s3-ap-southeast-2.amazonaws.com": "ap-southeast-2",

	"s3-ap-northeast-1.amazonaws.com": "ap-northeast-1",
	"s3.ap-northeast-2.amazonaws.com": "ap-northeast-2",
	"s3-ap-northeast-2.amazonaws.com": "ap-northeast-2",

	"s3-sa-east-1.amazonaws.com": "sa-east-1",

	"s3.cn-north-1.amazonaws.com.cn": "cn-north-1",
}

Functions

This section is empty.

Types

type S3Cli

type S3Cli struct {
	AccessKeyID          string `json:"access_key_id"`
	SecretAccessKey      string `json:"secret_access_key"`
	BucketName           string `json:"bucket_name"`
	FolderName           string `json:"folder_name"`
	CredentialsSource    string `json:"credentials_source"`
	Host                 string `json:"host"`
	Port                 int    `json:"port"` // 0 means no custom port
	Region               string `json:"region"`
	SSLVerifyPeer        bool   `json:"ssl_verify_peer"`
	UseSSL               bool   `json:"use_ssl"`
	SignatureVersion     int    `json:"signature_version,string"`
	ServerSideEncryption string `json:"server_side_encryption"`
	SSEKMSKeyID          string `json:"sse_kms_key_id"`
	UseV2SigningMethod   bool
	MultipartUpload      bool
}

The S3Cli represents configuration for the s3cli

func NewFromReader

func NewFromReader(reader io.Reader) (S3Cli, error)

NewFromReader returns a new s3cli configuration struct from the contents of reader. reader.Read() is expected to return valid JSON

func (*S3Cli) S3Endpoint

func (c *S3Cli) S3Endpoint() string

S3Endpoint returns the S3 URI to use if custom host information has been provided

func (*S3Cli) UseRegion

func (c *S3Cli) UseRegion() bool

UseRegion signals to users of the S3Cli whether to use Region information

Jump to

Keyboard shortcuts

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