package
0.0.0-20250313065730-4362ee8e7d18
Repository: https://github.com/joyrex2001/nightshift.git
Documentation: pkg.go.dev

# README

Trigger

Nightshift is able to trigger modules when a scale event occurs. These triggers can be used to e.g. disable alerting for the scaled down pods, or e.g. to start a pipeline which will trigger a specific process.

To add a new trigger, implement a factory method that implements the factory type, and register that method with a new type. This type will then be available in the config as a new scanner type.

The trigger itself should implement the Trigger interface. The Execute method is called when the trigger occurs. It will receive a list of scanner.Objects which were affected during the scaling and caused this trigger.

# Functions

New will return a Trigger object for given TriggerType.
NewWebhookTrigger will instantiate a new WebhookTrigger object.
RegisterModule will add the provided module, with given factory method to the list of available modules in order to support dependency injection, as well as easing up modular development for triggers.
RenderTemplate will render provided template.

# Structs

Config is the configuration for this trigger, and contains a hashmap with generic settings.
WebhookTrigger is the object that implements http based triggers.

# Interfaces

Trigger defines the public interface of trigger modules.

# Type aliases

Factory is the factory method for a trigger implementation module.