shard

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDs

func IDs(shards []shard.Shard) []uint32

IDs returns a new slice of shard IDs for a set of shards

func NewShards

func NewShards(ids []uint32, state shard.State) []shard.Shard

NewShards returns a new slice of shards with a specified state

func ShardsRange

func ShardsRange(from, to uint32, s shard.State) []shard.Shard

ShardsRange returns a slice of shards for all ids between [from, to], with shard state `s`.

Types

type ShardSet

type ShardSet interface {
	// All returns a slice to the shards in this set
	All() []shard.Shard

	// AllIDs returns a slice to the shard IDs in this set
	AllIDs() []uint32
}

ShardSet contains a sharding function and a set of shards, this interface allows for potentially out of order shard sets

func NewShardSet

func NewShardSet(shards []shard.Shard) ShardSet

NewShardSet creates a new sharding scheme with a set of shards

Directories

Path Synopsis
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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