objtools

package
v0.0.0-...-e3e1202 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Delim = "/" // Used by Mimir to delimit tenants and blocks, and objects within blocks.
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureClientConfig

type AzureClientConfig struct {
	ContainerName     string
	AccountName       string
	AccountKey        string
	CopyStatusBackoff backoff.Config
}

func (*AzureClientConfig) RegisterFlags

func (c *AzureClientConfig) RegisterFlags(prefix string, f *flag.FlagSet)

func (*AzureClientConfig) ToBucket

func (c *AzureClientConfig) ToBucket() (Bucket, error)

func (*AzureClientConfig) Validate

func (c *AzureClientConfig) Validate(prefix string) error

type Bucket

type Bucket interface {
	Get(ctx context.Context, objectName string, options GetOptions) (io.ReadCloser, error)
	ServerSideCopy(ctx context.Context, objectName string, dstBucket Bucket, options CopyOptions) error
	ClientSideCopy(ctx context.Context, objectName string, dstBucket Bucket, options CopyOptions) error
	List(ctx context.Context, options ListOptions) (*ListResult, error)
	RestoreVersion(ctx context.Context, name string, versionInfo VersionInfo) error
	Upload(ctx context.Context, objectName string, reader io.Reader, contentLength int64) error
	Delete(ctx context.Context, objectName string, options DeleteOptions) error
	Name() string
}

Bucket is an object storage interface intended to be used by tools that require functionality that isn't in objstore

type BucketConfig

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

func (*BucketConfig) RegisterFlags

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

func (*BucketConfig) ToBucket

func (c *BucketConfig) ToBucket(ctx context.Context) (Bucket, error)

func (*BucketConfig) Validate

func (c *BucketConfig) Validate() error

type CopyBucketConfig

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

func (*CopyBucketConfig) RegisterFlags

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

func (*CopyBucketConfig) ToBuckets

func (c *CopyBucketConfig) ToBuckets(ctx context.Context) (source Bucket, destination Bucket, copyFunc CopyFunc, err error)

func (*CopyBucketConfig) Validate

func (c *CopyBucketConfig) Validate() error

type CopyFunc

type CopyFunc func(context.Context, string, CopyOptions) error

CopyFunc copies from the source to the destination either client-side or server-side depending on the configuration

type CopyOptions

type CopyOptions struct {
	SourceVersionID       string
	DestinationObjectName string
}

type DeleteOptions

type DeleteOptions struct {
	VersionID string
}

type GCSClientConfig

type GCSClientConfig struct {
	BucketName string
}

func (*GCSClientConfig) RegisterFlags

func (c *GCSClientConfig) RegisterFlags(prefix string, f *flag.FlagSet)

func (*GCSClientConfig) ToBucket

func (c *GCSClientConfig) ToBucket(ctx context.Context) (Bucket, error)

func (*GCSClientConfig) Validate

func (c *GCSClientConfig) Validate(prefix string) error

type GetOptions

type GetOptions struct {
	VersionID string
}

type ListOptions

type ListOptions struct {
	Prefix    string
	Recursive bool
	Versioned bool
}

type ListResult

type ListResult struct {
	Objects  []ObjectAttributes
	Prefixes []string
}

func (*ListResult) ToNames

func (result *ListResult) ToNames() []string

func (*ListResult) ToNamesWithoutPrefix

func (result *ListResult) ToNamesWithoutPrefix(prefix string) ([]string, error)

type ObjectAttributes

type ObjectAttributes struct {
	Name         string
	Size         int64
	LastModified time.Time
	VersionInfo  VersionInfo
}

type S3ClientConfig

type S3ClientConfig struct {
	BucketName      string
	Endpoint        string
	AccessKeyID     string
	SecretAccessKey string
	Secure          bool
}

func (*S3ClientConfig) RegisterFlags

func (c *S3ClientConfig) RegisterFlags(prefix string, f *flag.FlagSet)

func (*S3ClientConfig) ToBucket

func (c *S3ClientConfig) ToBucket() (Bucket, error)

func (*S3ClientConfig) Validate

func (c *S3ClientConfig) Validate(prefix string) error

type VersionInfo

type VersionInfo struct {
	VersionID        string // Identifier for a particular version
	IsCurrent        bool   // If this is the current version
	RequiresUndelete bool   // Azure specific, the "deleted" state of noncurrent versions that must be "undeleted" before being promoted
	IsDeleteMarker   bool   // S3 specific, version that is created on an unversioned delete in a versioned bucket
}

Jump to

Keyboard shortcuts

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