sim

package
v0.0.0-...-e71dbe6 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAlreadyPushed indicates a dataset has already been published
	// TODO (b5) - move this into lib/remote
	ErrAlreadyPushed = fmt.Errorf("this dataset has already been published")
	// StatePushAttempted is the state to sync on once a pusher has tried to
	// push its dataset to all remotes, regardless of if the attempt was
	// successful
	StatePushAttempted = sync.State("push to all remotes attempted")
	// StatePullAttempted is the state to sync on once a puller has tried
	// pull a dataset from each remote, regardless of if the attempt was
	// successful
	StatePullAttempted = sync.State("pull from all remotes attempted")
	// StateConnectionAttempted is the state to sync on once an instance has attempted
	// to connect to each other instance
	StateConnectionAttempted = sync.State("connection to all other nodes attempted")
)
View Source
var (

	// StateActorConstructed is the state to sync on to check if all the
	// actors in the test have been constructed
	StateActorConstructed = sync.State("actor has been constructed")
)

Functions

This section is empty.

Types

type Actor

type Actor struct {
	Inst *lib.Instance
	// contains filtered or unexported fields
}

Actor is a peer in a network simulation

func NewActor

func NewActor(ctx context.Context, runenv *runtime.RunEnv, client sync.Client, seq int64, opts ...lib.Option) (*Actor, error)

NewActor creates an actor instance

func (*Actor) AddrInfo

func (a *Actor) AddrInfo() *peer.AddrInfo

AddrInfo provides this peers address information

func (*Actor) GenerateDatasetVersion

func (a *Actor) GenerateDatasetVersion(name string, numRows int) error

GenerateDatasetVersion creates & Saves a new version of a dataset Datasets are generic CSV datasets with only the number of rows configurable We're trying to test the network here. Size should be the only real concern

func (*Actor) ID

func (a *Actor) ID() string

ID provides a string identifier for this peer TODO (b5) - this should be a logbook identifier

func (*Actor) Info

func (a *Actor) Info(runenv *runtime.RunEnv) *ActorInfo

Info returns details about this actor

func (*Actor) Peername

func (a *Actor) Peername() string

Peername returns this actor's peername

type ActorInfo

type ActorInfo struct {
	Seq       int // sequence number within the test
	Peername  string
	ProfileID string
	AddrInfo  *peer.AddrInfo
}

ActorInfo carries details about an actor

type RemoteHooks

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

RemoteHooks implements remote behaviour for cloud backend to store and pin datasets. Remote invokes cloud infrastructure on successful push

func (*RemoteHooks) RemoteOptionsFunc

func (r *RemoteHooks) RemoteOptionsFunc() lib.Option

RemoteOptionsFunc creates a function to connect hooks to a remote at initialization

Jump to

Keyboard shortcuts

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