Documentation
¶
Overview ¶
Package interfaces defines the common interface types.
Index ¶
- type AbstractCmd
- func (cmd *AbstractCmd) ExtractDependencies(ctx context.Context, ski StateKeeperInterface) error
- func (cmd *AbstractCmd) GetCommandType() CommandType
- func (cmd *AbstractCmd) Instantiate(ctx context.Context, ski StateKeeperInterface) error
- func (cmd *AbstractCmd) UpdateStateKeeper(ctx context.Context, ski StateKeeperInterface) error
- type AbstractContainer
- type AbstractExecutor
- type AbstractSingleCmdByNoExecutor
- type AbstractTestExecutionConfig
- type CTPv2Builder
- type CommandConfigInterface
- type CommandInterface
- type CommandType
- type ConfigType
- type ContainerConfigInterface
- type ContainerInterface
- type ContainerType
- type DynamicTRv2Builder
- type ExecutorConfigInterface
- type ExecutorInterface
- type ExecutorType
- type MultipleCmdsByExecutor
- type SchedulerInterface
- type SchedulerType
- type SingleCmdByExecutor
- type StateKeeper
- type StateKeeperInterface
- type TestExecutionConfigInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractCmd ¶
type AbstractCmd struct { CommandInterface // contains filtered or unexported fields }
AbstractCmd satisfies the command requirement that is common to all.
func NewAbstractCmd ¶
func NewAbstractCmd(cmdType CommandType) *AbstractCmd
func (*AbstractCmd) ExtractDependencies ¶
func (cmd *AbstractCmd) ExtractDependencies( ctx context.Context, ski StateKeeperInterface) error
func (*AbstractCmd) GetCommandType ¶
func (cmd *AbstractCmd) GetCommandType() CommandType
func (*AbstractCmd) Instantiate ¶
func (cmd *AbstractCmd) Instantiate( ctx context.Context, ski StateKeeperInterface) error
func (*AbstractCmd) UpdateStateKeeper ¶
func (cmd *AbstractCmd) UpdateStateKeeper( ctx context.Context, ski StateKeeperInterface) error
type AbstractContainer ¶
type AbstractContainer struct {
ContainerInterface
}
AbstractContainer satisfies the container requirement that is common to all.
type AbstractExecutor ¶
type AbstractExecutor struct { ExecutorInterface // contains filtered or unexported fields }
AbstractExecutor satisfies the executor requirement that is common to all.
func NewAbstractExecutor ¶
func NewAbstractExecutor(exType ExecutorType) *AbstractExecutor
func (*AbstractExecutor) GetExecutorType ¶
func (ex *AbstractExecutor) GetExecutorType() ExecutorType
type AbstractSingleCmdByNoExecutor ¶
type AbstractSingleCmdByNoExecutor struct {
*AbstractCmd
}
AbstractSingleCmdByNoExecutor represents a single command with no executor.
type AbstractTestExecutionConfig ¶
type AbstractTestExecutionConfig struct {
// contains filtered or unexported fields
}
AbstractTestExecutionConfig satisfies the config requirement that is common to all.
func NewAbstractTestExecutionConfig ¶
func NewAbstractTestExecutionConfig(configType ConfigType) *AbstractTestExecutionConfig
func (*AbstractTestExecutionConfig) GetConfigType ¶
func (absConfig *AbstractTestExecutionConfig) GetConfigType() ConfigType
type CTPv2Builder ¶
type CTPv2Builder interface {
BuildRequest() *testapi.CTPv2Request
}
type CommandConfigInterface ¶
type CommandConfigInterface interface { // GetCommand returns the concrete command based on // provided command and executor type. GetCommand(CommandType, ExecutorType) (CommandInterface, error) }
CommandConfigInterface defines the contract a command config will have to satisfy.
type CommandInterface ¶
type CommandInterface interface { // GetCommandType returns the command type. GetCommandType() CommandType // Instantiate pulls data from the provided state keeper // to instantiate it during config generation. Instantiate(context.Context, StateKeeperInterface) error // ExtractDependencies extracts command dependencies from // the provided state keeper before command execution. ExtractDependencies(context.Context, StateKeeperInterface) error // Execute executes the command. Execute(context.Context) error // UpdateStateKeeper updates the provided state keeper after command execution. UpdateStateKeeper(context.Context, StateKeeperInterface) error }
CommandInterface defines the contract a command will have to satisfy.
func NewMultipleCmdsByExecutor ¶
func NewMultipleCmdsByExecutor( cmdType CommandType, executor ExecutorInterface, cmdList []CommandInterface) CommandInterface
type CommandType ¶
type CommandType string
type ConfigType ¶
type ConfigType string
type ContainerConfigInterface ¶
type ContainerConfigInterface interface { // GetContainer returns the concrete container based on // provided container type. GetContainer(contType ContainerType) (ContainerInterface, error) }
ContainerConfigInterface defines the contract container config will have to satisfy.
type ContainerInterface ¶
type ContainerInterface interface { // GetContainerType returns the container type. GetContainerType() ContainerType // Initialize initializes the container. Initialize(context.Context, *api.Template) error // StartContainer starts the container. StartContainer(context.Context) (*api.StartContainerResponse, error) // GetContainer gets the container related info. GetContainer(context.Context) (*api.GetContainerResponse, error) // ProcessContainer processes the container. // Ideally, this aggregates initialize, start and get together. ProcessContainer(context.Context, *api.Template) (string, error) // StopContainer stops the container. StopContainer(context.Context) error // GetLogsLocation returns the container activity logs location. GetLogsLocation() (string, error) }
ContainerInterface defines the contract a container will have to satisfy.
type ContainerType ¶
type ContainerType string
type DynamicTRv2Builder ¶
type DynamicTRv2Builder interface {
BuildRequest() (*testapi.CrosTestRunnerDynamicRequest, error)
}
type ExecutorConfigInterface ¶
type ExecutorConfigInterface interface { // GetExecutor returns the concrete executor based on provided executor type. GetExecutor(execType ExecutorType) (ExecutorInterface, error) }
ExecutorConfigInterface defines the contract an executor config will have to satisfy.
type ExecutorInterface ¶
type ExecutorInterface interface { // GetExecutorType returns the executor type. GetExecutorType() ExecutorType // ExecuteCommand executes the provided command via current executor. ExecuteCommand(context.Context, CommandInterface) error }
ExecutorInterface defines the contract an executor will have to satisfy.
type ExecutorType ¶
type ExecutorType string
type MultipleCmdsByExecutor ¶
type MultipleCmdsByExecutor struct { *AbstractCmd // contains filtered or unexported fields }
MultipleCmdsByExecutor represents multiple commands inside a single command executed by an executor.
type SchedulerInterface ¶
type SchedulerInterface interface { // GetSchedulerType returns the scheduler type GetSchedulerType() SchedulerType // Setup sets up the scheduler Setup(string) error // ScheduleRequest schedules requests, returning a BBID and a Device Manager // lease ID (if any). ScheduleRequest(context.Context, *buildbucketpb.ScheduleBuildRequest, *build.Step) (*buildbucketpb.Build, string, error) // GetStatus fetches and returns the current build status of the provided // BBID. GetStatus(requestID int64) (*buildbucketpb.Build, error) // GetResults returns the test results from the child TestRunner. GetResult(requestID int64) error // CancelTask terminates a running BuildBucket build with the passed in // BBID. CancelTask(requestID int64) error }
SchedulerInterface defines the contract a scheduler will have to satisfy.
type SingleCmdByExecutor ¶
type SingleCmdByExecutor struct { *AbstractCmd ConcreteCmd CommandInterface // contains filtered or unexported fields }
SingleCmdByExecutor represents a single command executed by an executor.
func NewSingleCmdByExecutor ¶
func NewSingleCmdByExecutor( cmdType CommandType, executor ExecutorInterface) *SingleCmdByExecutor
type StateKeeper ¶
type StateKeeper struct{}
StateKeeper that can be extended by other state keepers.
func (*StateKeeper) IsStateKeeper ¶
func (sk *StateKeeper) IsStateKeeper()
type StateKeeperInterface ¶
type StateKeeperInterface interface {
// IsStateKeeper indicates if current object is a state keeper.
IsStateKeeper()
}
StateKeeperInterface defines the contract a state keeper will have to satisfy.
type TestExecutionConfigInterface ¶
type TestExecutionConfigInterface interface { // GetConfigType returns the config type. GetConfigType() ConfigType // GenerateConfigs generates configs. GenerateConfigs(context.Context) error // Execute executes the generated execution config. Execute(context.Context, StateKeeperInterface) error }
TestExecutionConfigInterface defines the contract an execution config will have to satisfy.