sharded

package
v0.0.0-...-20d847b Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewShardedDownloader

func NewShardedDownloader[TReference ShardedReference](shards []object.Downloader[TReference]) object.Downloader[TReference]

NewShardedDownloader creates a decorator for one or more object.Downloaders that spreads out incoming requests based on the provided reference.

func NewShardedUploader

func NewShardedUploader[TReference ShardedReference, TLease any](shards []object.Uploader[TReference, TLease]) object.Uploader[TReference, TLease]

NewShardedUploader creates a decorator for one or more object.Uploaders that spreads out incoming requests based on the provided reference.

Types

type Picker

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

Picker of shards. Based on opaque data, Picker computes a hash and uses it to select a backend with a uniform distribution.

func NewPicker

func NewPicker(count int) Picker

func (Picker) PickShard

func (p Picker) PickShard(data []byte) int

type ShardedReference

type ShardedReference interface {
	GetRawReference() []byte
}

Jump to

Keyboard shortcuts

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