config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

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

This section is empty.

Functions

func AWSHostToRegion

func AWSHostToRegion(host string) string

func AlicloudHostToRegion

func AlicloudHostToRegion(host string) string

func Provider

func Provider(host string) string

Provider returns one of (aws, alicloud, google) based on a host name. Returns "" if a known provider cannot be detected.

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"`
	ServerSideEncryption                      string `json:"server_side_encryption"`
	SSEKMSKeyID                               string `json:"sse_kms_key_id"`
	AssumeRoleArn                             string `json:"assume_role_arn"`
	HostStyle                                 bool   `json:"host_style"`
	SwiftAuthAccount                          string `json:"swift_auth_account"`
	SwiftTempURLKey                           string `json:"swift_temp_url_key"`
	RequestChecksumCalculationEnabled         bool
	ResponseChecksumCalculationEnabled        bool
	UploaderRequestChecksumCalculationEnabled bool
	// Optional knobs to tune transfer performance.
	// If zero, the client will apply sensible defaults (handled by the S3 client layer).
	// Part size values are provided in bytes.
	DownloadConcurrency    int   `json:"download_concurrency"`
	DownloadPartSize       int64 `json:"download_part_size"`
	UploadConcurrency      int   `json:"upload_concurrency"`
	UploadPartSize         int64 `json:"upload_part_size"`
	MultipartCopyThreshold int64 `json:"multipart_copy_threshold"` // Default: 5GB - files larger than this use multipart copy
	MultipartCopyPartSize  int64 `json:"multipart_copy_part_size"` // Default: 100MB - size of each part in multipart copy

	// Files smaller than or equal to this size (in bytes) are uploaded using a single PutObject call.
	// Files exceeding this size use multipart upload. Omit or set to 0 to always use multipart upload.
	// Must not exceed 5GB (AWS S3 hard limit for PutObject, https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html).
	// For GCS, leave this unset (0); it will be automatically set to math.MaxInt64 since GCS requires single put for all uploads but has no size limit.
	SingleUploadThreshold int64 `json:"single_upload_threshold"`
}

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) IsGoogle

func (c *S3Cli) IsGoogle() bool

func (*S3Cli) S3Endpoint

func (c *S3Cli) S3Endpoint() string

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

func (*S3Cli) ShouldDisableRequestChecksumCalculation

func (c *S3Cli) ShouldDisableRequestChecksumCalculation() bool

func (*S3Cli) ShouldDisableResponseChecksumCalculation

func (c *S3Cli) ShouldDisableResponseChecksumCalculation() bool

func (*S3Cli) ShouldDisableUploaderRequestChecksumCalculation

func (c *S3Cli) ShouldDisableUploaderRequestChecksumCalculation() bool

Jump to

Keyboard shortcuts

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