Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( WorkingDir string TempDir string EventCh chan Event )
View Source
var ContextBindingType = map[BindingType]string{ Schedule: "schedule", OnStartup: "onStartup", KubeEvents: "onKubernetesEvent", }
Functions ¶
This section is empty.
Types ¶
type BindingContext ¶
type BindingContext struct { Binding string `json:"binding"` ResourceEvent string `json:"resourceEvent,omitempty"` ResourceNamespace string `json:"resourceNamespace,omitempty"` ResourceKind string `json:"resourceKind,omitempty"` ResourceName string `json:"resourceName,omitempty"` }
Additional info from schedule and kube events
type BindingType ¶
type BindingType string
const ( Schedule BindingType = "SCHEDULE" OnStartup BindingType = "ON_STARTUP" KubeEvents BindingType = "KUBE_EVENTS" )
type Hook ¶
type Hook struct { Name string // The unique name like '002-prometheus-hooks/startup_hook'. Path string // The absolute path to the executable file. Bindings []BindingType OrderByBinding map[BindingType]float64 Config *HookConfig // contains filtered or unexported fields }
func (*Hook) Run ¶
func (h *Hook) Run(bindingType BindingType, context []BindingContext) error
type HookConfig ¶
type HookConfig struct { OnStartup interface{} `json:"onStartup"` Schedule []schedule_manager.ScheduleConfig `json:"schedule"` OnKubernetesEvent []kube_events_manager.OnKubernetesEventConfig `json:"onKubernetesEvent"` }
type HookManager ¶
type HookManager interface { Run() GetHook(name string) (*Hook, error) GetHooksInOrder(bindingType BindingType) []string RunHook(hookName string, binding BindingType, bindingContext []BindingContext) error }
type MainHookManager ¶
type MainHookManager struct {
// contains filtered or unexported fields
}
func NewMainHookManager ¶
func NewMainHookManager() *MainHookManager
func (*MainHookManager) GetHooksInOrder ¶
func (hm *MainHookManager) GetHooksInOrder(bindingType BindingType) []string
func (*MainHookManager) Run ¶
func (hm *MainHookManager) Run()
HookManager has no events for now unlike antiopa
func (*MainHookManager) RunHook ¶
func (hm *MainHookManager) RunHook(hookName string, binding BindingType, bindingContext []BindingContext) error
Click to show internal directories.
Click to hide internal directories.