azure

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobStorage

type BlobStorage struct {
	// contains filtered or unexported fields
}

BlobStorage is used to interact with azure blob storage for setting or getting time series chunks. Implements ObjectStorage

func NewBlobStorage

func NewBlobStorage(cfg *BlobStorageConfig, metrics BlobStorageMetrics, hedgingCfg hedging.Config) (*BlobStorage, error)

NewBlobStorage creates a new instance of the BlobStorage struct.

func (*BlobStorage) DeleteObject

func (b *BlobStorage) DeleteObject(ctx context.Context, blobID string) error

func (*BlobStorage) GetObject

func (b *BlobStorage) GetObject(ctx context.Context, objectKey string) (io.ReadCloser, int64, error)

GetObject returns a reader and the size for the specified object key.

func (*BlobStorage) GetObjectRange added in v3.2.0

func (b *BlobStorage) GetObjectRange(ctx context.Context, objectKey string, offset, length int64) (io.ReadCloser, error)

GetObject returns a reader and the size for the specified object key.

func (*BlobStorage) IsObjectNotFoundErr

func (b *BlobStorage) IsObjectNotFoundErr(err error) bool

IsObjectNotFoundErr returns true if error means that object is not found. Relevant to GetObject and DeleteObject operations.

func (*BlobStorage) IsRetryableErr

func (b *BlobStorage) IsRetryableErr(error) bool

TODO(dannyk): implement for client

func (*BlobStorage) List

func (b *BlobStorage) List(ctx context.Context, prefix, delimiter string) ([]client.StorageObject, []client.StorageCommonPrefix, error)

List implements chunk.ObjectClient.

func (*BlobStorage) ObjectExists

func (b *BlobStorage) ObjectExists(ctx context.Context, objectKey string) (bool, error)

func (*BlobStorage) PutObject

func (b *BlobStorage) PutObject(ctx context.Context, objectKey string, object io.Reader) error

func (*BlobStorage) Stop

func (b *BlobStorage) Stop()

Stop is a no op, as there are no background workers with this driver currently

type BlobStorageConfig

type BlobStorageConfig struct {
	Environment         string         `yaml:"environment"`
	StorageAccountName  string         `yaml:"account_name"`
	StorageAccountKey   flagext.Secret `yaml:"account_key"`
	ConnectionString    string         `yaml:"connection_string"`
	ContainerName       string         `yaml:"container_name"`
	EndpointSuffix      string         `yaml:"endpoint_suffix"`
	UseManagedIdentity  bool           `yaml:"use_managed_identity"`
	UseFederatedToken   bool           `yaml:"use_federated_token"`
	UserAssignedID      string         `yaml:"user_assigned_id"`
	UseServicePrincipal bool           `yaml:"use_service_principal"`
	ClientID            string         `yaml:"client_id"`
	ClientSecret        flagext.Secret `yaml:"client_secret"`
	TenantID            string         `yaml:"tenant_id"`
	ChunkDelimiter      string         `yaml:"chunk_delimiter"`
	DownloadBufferSize  int            `yaml:"download_buffer_size"`
	UploadBufferSize    int            `yaml:"upload_buffer_size"`
	UploadBufferCount   int            `yaml:"upload_buffer_count"`
	RequestTimeout      time.Duration  `yaml:"request_timeout"`
	MaxRetries          int            `yaml:"max_retries"`
	MinRetryDelay       time.Duration  `yaml:"min_retry_delay"`
	MaxRetryDelay       time.Duration  `yaml:"max_retry_delay"`
}

BlobStorageConfig defines the configurable flags that can be defined when using azure blob storage.

func (*BlobStorageConfig) RegisterFlags

func (c *BlobStorageConfig) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to config this to the given FlagSet

func (*BlobStorageConfig) RegisterFlagsWithPrefix

func (c *BlobStorageConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)

RegisterFlagsWithPrefix adds the flags required to config this to the given FlagSet

func (*BlobStorageConfig) Validate

func (c *BlobStorageConfig) Validate() error

Validate the config.

type BlobStorageMetrics

type BlobStorageMetrics struct {
	// contains filtered or unexported fields
}

func NewBlobStorageMetrics

func NewBlobStorageMetrics() BlobStorageMetrics

NewBlobStorageMetrics creates the blob storage metrics struct and registers all of it's metrics.

func (*BlobStorageMetrics) Unregister

func (bm *BlobStorageMetrics) Unregister()

Unregister unregisters the blob storage metrics with the prometheus default registerer, useful for tests where we frequently need to create multiple instances of the metrics struct, but not globally.

type ParsedConnectionString

type ParsedConnectionString struct {
	ServiceURL  string
	AccountName string
	AccountKey  string
}

Jump to

Keyboard shortcuts

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