noopcontroller

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopController

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

NoopController is a very basic implementation of a controller. NoopController, it just performs a pre-defined set of actions in a loop.

func New

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

New creates and initializes a new NoopController 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 (*NoopController) InjectAction added in v1.10.0

func (c *NoopController) InjectAction(actionID string) error

InjectAction allows a named UserAction to be injected that is run once, at the next available opportunity. These actions can be injected via the coordinator via CLI or Rest API.

func (*NoopController) Run

func (c *NoopController) 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 (*NoopController) SetRate

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

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

func (*NoopController) Stop

func (c *NoopController) Stop()

Stop stops the controller.

Jump to

Keyboard shortcuts

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