package
Version:
v0.0.0-...-678bb0e
Opens a new window with list of versions in this module.
Published: Aug 8, 2017
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package shards provides a low level support for implementing sharded set of
[]byte blobs.
func ShardIndex(member []byte, shardCount int) int
ShardIndex returns an index of a shard to use when storing given blob.
Set is an array of shards (representing a single sharded set).
The size of the array is number of shards in the set. Allocate it using
regular make(...).
Insert adds a blob into the sharded set.
type Shard map[string]struct{}
Shard is a set of byte blobs.
It represents s single shard of a sharded set.
ParseShard deserializes a shard (serialized with Serialize).
Serialize serializes the shard to a byte buffer.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.