trigger

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// Manager is the controller manager for all the running controller
	// against agent manager.
	Manager *controller.Manager

	// Triggers contains the specification of the triggers configured on the agent.
	Triggers map[string]*Trigger

	// DefaultTriggers contains a list of default triggers configured for the agent
	// These are basically Webhook configured triggers and hence don't need a controller
	// to function
	DefaultTriggers map[string]struct{}
	// contains filtered or unexported fields
}

Controller contains the implementation of the trigger controller.

var TriggerCtrl *Controller = NewController()

TriggerCtrl is the global instance of the trigger controller running for the agent.

func NewController

func NewController() *Controller

NewController returns a new agent controller manager which manages all the triggers configured on the agent.

func (*Controller) Configure

func (c *Controller) Configure()

Configure sets up the trigger controller and all its required components.

func (*Controller) InvokeTrigger

func (c *Controller) InvokeTrigger(ctx context.Context, triggerName string) error

InvokeTrigger invokes the trigger with the provided name

func (*Controller) Name

func (c *Controller) Name() string

Name returns the name of the agent controller, it is completely defined by the name of the underlying store controller.

func (*Controller) Run

func (c *Controller) Run() error

Run starts running the trigger controller on the agent.

func (*Controller) Stop

func (c *Controller) Stop() error

Stop shuts down the controller.

func (*Controller) TriggerPipelineRun

func (c *Controller) TriggerPipelineRun(ctx context.Context, triggerName, pipelineName string) error

TriggerPipelineRun invokes the trigger associated pipeline with the provided name

func (*Controller) Type

func (c *Controller) Type() string

Type returns the type of controller configured, for trigger this is trigger.

type Trigger

type Trigger struct {
	// RunningPipelines is set to true if the Trigger is currently running
	// any pipeline.
	RunningPipelines int

	// UpdateAvailable indidcates wheather an update is available for the trigger
	// configured, if a signal is recieved it will first try and let all the running pipeline
	// execute and then update the manifest scheduling further pipelines run
	// later on.
	UpdateAvailable bool

	// TriggerSpecWithName contains the specification manifest of the trigger.
	*v1alpha1.TriggerSpecWithName
}

Trigger contains details corresponding to the provided trigger.

func (*Trigger) RunPipeline

func (t *Trigger) RunPipeline(ctx context.Context, manager *controller.Manager, pipeline string) error

RunPipeline runs a single pipeline associated with the trigger.

func (*Trigger) RunPipelines

func (t *Trigger) RunPipelines(ctx context.Context, manager *controller.Manager) error

RunPipelines runs the pipelines associated with the trigger.

func (*Trigger) SetupController

func (t *Trigger) SetupController(manager *controller.Manager) error

SetupController sets up the controller for the trigger.

func (*Trigger) StopController

func (t *Trigger) StopController(manager *controller.Manager) error

StopController stops the controller for the trigger.

Jump to

Keyboard shortcuts

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