forked from cortexproject/cortex
/
config.go
24 lines (19 loc) · 920 Bytes
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package gcs
import (
"flag"
"github.com/cortexproject/cortex/pkg/util/flagext"
)
// Config holds the config options for GCS backend
type Config struct {
BucketName string `yaml:"bucket_name"`
ServiceAccount flagext.Secret `yaml:"service_account"`
}
// RegisterFlags registers the flags for TSDB GCS storage
func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
cfg.RegisterFlagsWithPrefix("blocks-storage.", f)
}
// RegisterFlagsWithPrefix registers the flags for TSDB GCS storage with the provided prefix
func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) {
f.StringVar(&cfg.BucketName, prefix+"gcs.bucket-name", "", "GCS bucket name")
f.Var(&cfg.ServiceAccount, prefix+"gcs.service-account", "JSON representing either a Google Developers Console client_credentials.json file or a Google Developers service account key file. If empty, fallback to Google default logic.")
}