executor

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	Execute(event *eventqueue.Event) error
}

Executor interface should be implemented by all executors. Executor interface is compatible with the QueueExecutor interface in eventqueue package.

func New

func New(exType Type, exOpts Opts) (Executor, error)

New creates a new instance of the executor and returns it. It will error out if the executor type is not supported. Supported executor types are: - script - eventsrunner - log If the a required config is not provided for the specific executor, New method will error out.

type LogExecutor

type LogExecutor struct{}

LogExecutor is the simplest executor which will just log the event. It is used for testing purposes. Compatible with the Executor Interface

func (*LogExecutor) Execute

func (le *LogExecutor) Execute(event *eventqueue.Event) error

Execute logs the event.

type Opts

type Opts struct {
	ScriptDir    string
	ScriptPrefix string
	AuthType     client.AuthType
	client.EventsRunnerClientOpts
}

Opts contains options for creating any type of executor. New method will error out if a required config is not provided for the specific executor. - ScriptDir: Directory where the scripts are located. - ScriptPrefix: Prefix of the scripts. - AuthType: Type of authentication to be used for eventsrunner client auth. - EventsRunnerClientOpts: Options for creating eventsrunner client. Refer to the eventsrunner client package for more details.

type Type

type Type string

Type is the type of the executor.

const (
	// SCRIPT is the type of the script executor.
	SCRIPT Type = "script"
	// ER is the type of the eventsrunner executor.
	ER Type = "eventsrunner"
	// LOG is the type of the log executor.
	LOG Type = "log"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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