commandGenerator

package
v3.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package commandGenerator includes the interface and the implementation for generating commands to process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandGenerator

type CommandGenerator interface {
	// GetNextCommand should return a cmd produced by CommandGenerator
	GetNextCommand(ctx context.Context) api.Cmd

	// IsEndOfCommands should return true when there is no more command
	// to be produced.
	IsEndOfCommands() bool

	// GetNumOfRemainingCommands should return total number of commands to be generated
	GetNumOfRemainingCommands() uint64
}

CommandGenerator is the interface to get commands from an arbitrary source. Implementers of this interface should be able to produce commands when asked until they cannot produce any new command.

func NewLinearCommandGenerator

func NewLinearCommandGenerator(initialCommands []api.Cmd, realCommands []api.Cmd) CommandGenerator

NewLinearCommandGenerator generates a command generator that takes a list of cmds and returns them in order when GetNextCommand is called.

Jump to

Keyboard shortcuts

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