sim

package
v0.0.0-...-2dc6dcb Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: GPL-3.0 Imports: 18 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")
)

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, opts ...func(cfg *Config)) (*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
	PeerID   string
	AddrInfo *peer.AddrInfo
}

ActorInfo carries details about an actor

type Config

type Config struct {
	QriConfig     *config.Config
	EventHandlers map[event.Topic]func(payload interface{})
}

Config

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