objectclient

package
v2.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FSEncoder = func(schema chunk.SchemaConfig, chk chunk.Chunk) string {

	key := schema.ExternalKey(chk)
	if schema.VersionForChunk(chk) > 11 {
		split := strings.LastIndexByte(key, '/')
		encodedTail := base64Encoder(key[split+1:])
		return strings.Join([]string{key[:split], encodedTail}, "/")

	}
	return base64Encoder(key)
}

Functions

This section is empty.

Types

type Client

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

Client is used to store chunks in object store backends

func NewClient

func NewClient(store chunk.ObjectClient, encoder KeyEncoder, schema chunk.SchemaConfig) *Client

NewClient wraps the provided ObjectClient with a chunk.Client implementation

func NewClientWithMaxParallel

func NewClientWithMaxParallel(store chunk.ObjectClient, encoder KeyEncoder, maxParallel int, schema chunk.SchemaConfig) *Client

func (*Client) DeleteChunk

func (o *Client) DeleteChunk(ctx context.Context, userID, chunkID string) error

GetChunks retrieves the specified chunks from the configured backend

func (*Client) GetChunks

func (o *Client) GetChunks(ctx context.Context, chunks []chunk.Chunk) ([]chunk.Chunk, error)

GetChunks retrieves the specified chunks from the configured backend

func (*Client) IsChunkNotFoundErr

func (o *Client) IsChunkNotFoundErr(err error) bool

func (*Client) PutChunks

func (o *Client) PutChunks(ctx context.Context, chunks []chunk.Chunk) error

PutChunks stores the provided chunks in the configured backend. If multiple errors are returned, the last one sequentially will be propagated up.

func (*Client) Stop

func (o *Client) Stop()

Stop shuts down the object store and any underlying clients

type KeyEncoder

type KeyEncoder func(schema chunk.SchemaConfig, chk chunk.Chunk) string

KeyEncoder is used to encode chunk keys before writing/retrieving chunks from the underlying ObjectClient Schema/Chunk are passed as arguments to allow this to improve over revisions

Jump to

Keyboard shortcuts

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