simulcontroller

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimulController

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

SimulController is a simulative implementation of a UserController.

func New

func New(id int, user user.User, status chan<- control.UserStatus) (*SimulController, error)

New creates and initializes a new SimulController with given parameters. An id is provided to identify the controller, a User is passed as the entity to be controlled and a UserStatus channel is passed to communicate errors and information about the user's status.

func (*SimulController) Run

func (c *SimulController) Run()

Run begins performing a set of user actions in a loop. It keeps on doing it until Stop() is invoked. This is also a blocking function, so it is recommended to invoke it inside a goroutine.

func (*SimulController) SetRate

func (c *SimulController) SetRate(rate float64) error

SetRate sets the relative speed of execution of actions by the user.

func (*SimulController) Stop

func (c *SimulController) Stop()

Stop stops the controller.

Jump to

Keyboard shortcuts

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