generation

package
Version: v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Generates a full netsim test, given a log-splicer processed ssb-fixtures folder and a replication expectations file expectations.json.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTest

func GenerateTest(args Args, expectations map[string][]string, outputWriter io.Writer)

func GetFollowMap

func GetFollowMap(followGraphPath string) (map[string][]string, map[string]map[string]bool, error)

Returns a map of follows (id -> slice of ids that are followed), a map of blocks (g.isBlocking[id][otherId] = true if id blocks otherId)

func GetIdentities

func GetIdentities(fixturesRoot string) (map[string]string, error)

Produces a map of hex identifiers to the folder storing the puppet's id & log.offset

func PickName

func PickName(splicedFixturesMap map[string]interface{}) string

Types

type Args

type Args struct {
	SSBServer    string
	FixturesRoot string
	FocusedCount int
	MaxHops      int
	Seed         int64
}

type Generator

type Generator struct {
	// The cohort of peers we care about; the ones who will be issuing `has` stmts, the ones whose data we will inspect
	FocusGroup []string
	IDsToNames map[string]string
	NamesToIDs map[string]string

	Args Args

	Output io.Writer
	// contains filtered or unexported fields
}

func (Generator) GetIDs

func (g Generator) GetIDs(src []string) []string

type Graph

type Graph struct {
	FollowMap map[string][]string
	Seen      map[string]bool
	Gen       Generator
}

func (Graph) RecurseFollows

func (g Graph) RecurseFollows(id string, hopsLeft int, verbose bool) []Pair

TODO: change pair to { src: string, dst: []string }? the above ^ change can also take care of batching the dst's into correct sized buckets. if len(dst) > SOME_MAX, then we push what we already have to the pairs slice and start populating a new slice of destinations

type Pair

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL