Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregatedShardFn ¶
AggregatedShardFn maps a chunked id to a shard.
type HashType ¶
type HashType string
HashType is the hashing type.
const ( // Murmur32Hash represents the murmur3 hash. Murmur32Hash HashType = "murmur32" DefaultHash = Murmur32Hash )
List of supported hashing types.
func (HashType) AggregatedShardFn ¶
func (t HashType) AggregatedShardFn() (AggregatedShardFn, error)
AggregatedShardFn returns the sharding function for computing aggregated shards.
func (HashType) MustShardFn ¶
MustShardFn returns the sharding function, or panics if an error is encountered.
func (*HashType) UnmarshalYAML ¶
UnmarshalYAML unmarshals YAML object into a hash type.
type ShardSet ¶
type ShardSet map[uint32]struct{}
ShardSet is a collection of shards organized as a set. The shards contained in the set can be discontinuous.
func MustParseShardSet ¶
MustParseShardSet parses a shard set from the input string, and panics if parsing is unsuccessful.
func ParseShardSet ¶
ParseShardSet parses a shard set from the input string.
func (ShardSet) AddBetween ¶
AddBetween adds shards between the given min (inclusive) and max (exclusive).
func (ShardSet) ParseRange ¶
ParseRange parses a range of shards and adds them to the set.
func (*ShardSet) UnmarshalYAML ¶
UnmarshalYAML unmarshals YAML into a shard set. The following formats are supported: * StartShard..EndShard, e.g., 0..63. * Single shard, e.g., 5. * Array containing shard ranges and single shards.