github.com/muhammadn/cortex@v1.9.1-0.20220510110439-46bb7000d03d/pkg/storage/bucket/azure/config.go (about)

     1  package azure
     2  
     3  import (
     4  	"flag"
     5  
     6  	"github.com/grafana/dskit/flagext"
     7  )
     8  
     9  // Config holds the config options for an Azure backend
    10  type Config struct {
    11  	StorageAccountName string         `yaml:"account_name"`
    12  	StorageAccountKey  flagext.Secret `yaml:"account_key"`
    13  	ContainerName      string         `yaml:"container_name"`
    14  	Endpoint           string         `yaml:"endpoint_suffix"`
    15  	MaxRetries         int            `yaml:"max_retries"`
    16  }
    17  
    18  // RegisterFlags registers the flags for Azure storage
    19  func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
    20  	cfg.RegisterFlagsWithPrefix("", f)
    21  }
    22  
    23  // RegisterFlagsWithPrefix registers the flags for Azure storage
    24  func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) {
    25  	f.StringVar(&cfg.StorageAccountName, prefix+"azure.account-name", "", "Azure storage account name")
    26  	f.Var(&cfg.StorageAccountKey, prefix+"azure.account-key", "Azure storage account key")
    27  	f.StringVar(&cfg.ContainerName, prefix+"azure.container-name", "", "Azure storage container name")
    28  	f.StringVar(&cfg.Endpoint, prefix+"azure.endpoint-suffix", "", "Azure storage endpoint suffix without schema. The account name will be prefixed to this value to create the FQDN")
    29  	f.IntVar(&cfg.MaxRetries, prefix+"azure.max-retries", 20, "Number of retries for recoverable errors")
    30  }