Documentation
¶
Index ¶
- Constants
- Variables
- func NewBucket(ctx context.Context, cfg Config, name string) (phlareobj.Bucket, error)
- type Config
- type ErrInvalidCharactersInStoragePrefix
- type StorageBackendConfig
- func (cfg *StorageBackendConfig) RegisterFlags(f *flag.FlagSet)
- func (cfg *StorageBackendConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
- func (cfg *StorageBackendConfig) RegisterFlagsWithPrefixAndDefaultDirectory(prefix, dir string, f *flag.FlagSet)
- func (cfg *StorageBackendConfig) Validate() error
Constants ¶
View Source
const ( // None is the null value for the storage backends. None = "" // S3 is the value for the S3 storage backend. S3 = "s3" // GCS is the value for the GCS storage backend. GCS = "gcs" // Azure is the value for the Azure storage backend. Azure = "azure" // Swift is the value for the Openstack Swift storage backend. Swift = "swift" // COS is the value for the Tencent Cloud COS storage backend. COS = "cos" // Filesystem is the value for the filesystem storage backend. Filesystem = "filesystem" )
Variables ¶
View Source
var ( SupportedBackends = []string{S3, GCS, Azure, Swift, Filesystem, COS} ErrUnsupportedStorageBackend = errors.New("unsupported storage backend") ErrStoragePrefixStartsWithSlash = errors.New("storage prefix starts with a slash") ErrStoragePrefixEmptyPathSegment = errors.New("storage prefix contains an empty path segment") ErrStoragePrefixInvalidCharacters = errors.New("storage prefix contains invalid characters: only alphanumeric, hyphen, underscore, dot, and no segement should be . or ..") ErrStoragePrefixBothFlagsSet = errors.New("both storage.prefix and storage.storage-prefix are set, please use only storage.prefix, as storage.storage-prefix is deprecated.") )
Functions ¶
Types ¶
type Config ¶
type Config struct {
StorageBackendConfig `yaml:",inline"`
Prefix string `yaml:"prefix"`
DeprecatedStoragePrefix string `yaml:"storage_prefix" category:"experimental"` // Deprecated: use Prefix instead
// Not used internally, meant to allow callers to wrap Buckets
// created using this config
Middlewares []func(objstore.Bucket) (objstore.Bucket, error) `yaml:"-"`
}
Config holds configuration for accessing long-term storage.
func (*Config) RegisterFlags ¶
RegisterFlags registers the backend storage config.
func (*Config) RegisterFlagsWithPrefix ¶
func (*Config) RegisterFlagsWithPrefixAndDefaultDirectory ¶
type ErrInvalidCharactersInStoragePrefix ¶
type ErrInvalidCharactersInStoragePrefix struct {
Prefix string
}
func (*ErrInvalidCharactersInStoragePrefix) Error ¶ added in v1.12.1
func (e *ErrInvalidCharactersInStoragePrefix) Error() string
type StorageBackendConfig ¶
type StorageBackendConfig struct {
Backend string `yaml:"backend"`
// Backends
S3 s3.Config `yaml:"s3"`
GCS gcs.Config `yaml:"gcs"`
Azure azure.Config `yaml:"azure"`
Swift swift.Config `yaml:"swift"`
COS cos.Config `yaml:"cos"`
Filesystem filesystem.Config `yaml:"filesystem"`
}
func (*StorageBackendConfig) RegisterFlags ¶
func (cfg *StorageBackendConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags registers the backend storage config.
func (*StorageBackendConfig) RegisterFlagsWithPrefix ¶
func (cfg *StorageBackendConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
func (*StorageBackendConfig) RegisterFlagsWithPrefixAndDefaultDirectory ¶
func (cfg *StorageBackendConfig) RegisterFlagsWithPrefixAndDefaultDirectory(prefix, dir string, f *flag.FlagSet)
func (*StorageBackendConfig) Validate ¶
func (cfg *StorageBackendConfig) Validate() error
Click to show internal directories.
Click to hide internal directories.