testutil

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNewTopologyMap

func MustNewTopologyMap(replicas int, assignment map[string][]shard.Shard) topology.Map

MustNewTopologyMap returns a new topology.Map with provided parameters. It's a utility method to make tests easier to write.

func NewStateSnapshot

func NewStateSnapshot(hostShardStates HostShardStates) *topology.StateSnapshot

NewStateSnapshot creates a new initial topology state snapshot using HostShardStates as input.

Types

type HostShardStates

type HostShardStates map[string][]shard.Shard

HostShardStates is a human-readable way of describing an initial state topology on a host-by-host basis.

type TopologyView

type TopologyView struct {
	Replicas   int
	Assignment map[string][]shard.Shard
}

TopologyView represents a snaphshot view of a topology.Map.

func NewTopologyView

func NewTopologyView(replicas int, assignment map[string][]shard.Shard) TopologyView

NewTopologyView returns a new TopologyView with provided parameters. It's a utility method to make tests easier to write.

func (TopologyView) Map

func (v TopologyView) Map() (topology.Map, error)

Map returns the topology.Map corresponding to a TopologyView.

Jump to

Keyboard shortcuts

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