Documentation ¶
Index ¶
- type Controller
- func (c *Controller) Configure()
- func (c *Controller) InvokeTrigger(ctx context.Context, triggerName string) error
- func (c *Controller) Name() string
- func (c *Controller) Run() error
- func (c *Controller) Stop() error
- func (c *Controller) TriggerPipelineRun(ctx context.Context, triggerName, pipelineName string) error
- func (c *Controller) Type() string
- type Trigger
- func (t *Trigger) RunPipeline(ctx context.Context, manager *controller.Manager, pipeline string) error
- func (t *Trigger) RunPipelines(ctx context.Context, manager *controller.Manager) error
- func (t *Trigger) SetupController(manager *controller.Manager) error
- func (t *Trigger) StopController(manager *controller.Manager) error
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) 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 ¶
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.