-
Notifications
You must be signed in to change notification settings - Fork 693
Expand file tree
/
Copy pathconfig.go
More file actions
37 lines (32 loc) · 1.41 KB
/
config.go
File metadata and controls
37 lines (32 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package s3
import (
"time"
"github.com/grafana/dskit/crypto/tls"
"github.com/grafana/dskit/flagext"
)
type Config struct {
tls.ClientConfig `yaml:",inline"`
Bucket string `yaml:"bucket"`
Prefix string `yaml:"prefix"`
Endpoint string `yaml:"endpoint"`
Region string `yaml:"region"`
AccessKey string `yaml:"access_key"`
SecretKey flagext.Secret `yaml:"secret_key"`
SessionToken flagext.Secret `yaml:"session_token"`
Insecure bool `yaml:"insecure"`
PartSize uint64 `yaml:"part_size"`
HedgeRequestsAt time.Duration `yaml:"hedge_requests_at"`
HedgeRequestsUpTo int `yaml:"hedge_requests_up_to"`
// SignatureV2 configures the object storage to use V2 signing instead of V4
SignatureV2 bool `yaml:"signature_v2"`
ForcePathStyle bool `yaml:"forcepathstyle"`
BucketLookupType int `yaml:"bucket_lookup_type"`
Tags map[string]string `yaml:"tags"`
StorageClass string `yaml:"storage_class"`
Metadata map[string]string `yaml:"metadata"`
NativeAWSAuthEnabled bool `yaml:"native_aws_auth_enabled"`
}
func (c *Config) PathMatches(other *Config) bool {
// S3 bucket names are globally unique
return c.Bucket == other.Bucket && c.Prefix == other.Prefix
}