shell_operator

package
v1.0.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: Apache-2.0 Imports: 28 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitAndStart

func InitAndStart(operator *ShellOperator) error

Types

type ManagerEventsHandler

type ManagerEventsHandler struct {
	// contains filtered or unexported fields
}

func NewManagerEventsHandler

func NewManagerEventsHandler() *ManagerEventsHandler

func (*ManagerEventsHandler) Start

func (m *ManagerEventsHandler) Start()

func (*ManagerEventsHandler) Stop

func (m *ManagerEventsHandler) Stop()

func (*ManagerEventsHandler) WithContext

func (m *ManagerEventsHandler) WithContext(ctx context.Context)

func (*ManagerEventsHandler) WithKubeEventHandler

func (m *ManagerEventsHandler) WithKubeEventHandler(fn func(kubeEvent KubeEvent) []task.Task)

func (*ManagerEventsHandler) WithKubeEventsManager

func (m *ManagerEventsHandler) WithKubeEventsManager(mgr kube_events_manager.KubeEventsManager)

func (*ManagerEventsHandler) WithScheduleEventHandler

func (m *ManagerEventsHandler) WithScheduleEventHandler(fn func(crontab string) []task.Task)

func (*ManagerEventsHandler) WithScheduleManager

func (m *ManagerEventsHandler) WithScheduleManager(mgr schedule_manager.ScheduleManager)

func (*ManagerEventsHandler) WithTaskQueueSet

func (m *ManagerEventsHandler) WithTaskQueueSet(tqs *queue.TaskQueueSet)

type ShellOperator

type ShellOperator struct {
	HooksDir string
	TempDir  string

	MetricStorage *metrics_storage.MetricStorage
	KubeClient    kube.KubernetesClient

	ScheduleManager   schedule_manager.ScheduleManager
	KubeEventsManager kube_events_manager.KubeEventsManager

	TaskQueues *queue.TaskQueueSet

	ManagerEventsHandler *ManagerEventsHandler

	HookManager hook.HookManager
	// contains filtered or unexported fields
}

func DefaultOperator

func DefaultOperator() *ShellOperator

func NewShellOperator

func NewShellOperator() *ShellOperator

func (*ShellOperator) Init

func (op *ShellOperator) Init() (err error)

Init does some basic checks and instantiate managers

- check settings: directories, kube config - initialize managers: hook manager, kube events manager, schedule manager - create an empty task queue

func (*ShellOperator) InitAndStartHookQueues

func (op *ShellOperator) InitAndStartHookQueues()

CreateQueues create all queues defined in hooks

func (*ShellOperator) InitHookManager

func (op *ShellOperator) InitHookManager() (err error)

InitHookManager load hooks from HooksDir and defines event handlers that emit tasks.

func (*ShellOperator) PrepopulateMainQueue

func (op *ShellOperator) PrepopulateMainQueue(tqs *queue.TaskQueueSet)

PrepopulateMainQueue adds tasks to run hooks with OnStartup bindings and tasks to enable kubernetes bindings.

func (*ShellOperator) RunMetrics

func (op *ShellOperator) RunMetrics()

func (*ShellOperator) SetupHttpServerHandles

func (op *ShellOperator) SetupHttpServerHandles()

func (*ShellOperator) Start

func (op *ShellOperator) Start()

func (*ShellOperator) StartHttpServer

func (op *ShellOperator) StartHttpServer(ip string, port string) error

func (*ShellOperator) Stop

func (op *ShellOperator) Stop()

func (*ShellOperator) TaskHandler

func (op *ShellOperator) TaskHandler(t task.Task) queue.TaskResult

TaskHandler

func (*ShellOperator) WithContext

func (op *ShellOperator) WithContext(ctx context.Context) *ShellOperator

func (*ShellOperator) WithHooksDir

func (op *ShellOperator) WithHooksDir(dir string)

func (*ShellOperator) WithKubernetesClient

func (op *ShellOperator) WithKubernetesClient(klient kube.KubernetesClient)

func (*ShellOperator) WithMetricStorage

func (op *ShellOperator) WithMetricStorage(metricStorage *metrics_storage.MetricStorage)

func (*ShellOperator) WithTempDir

func (op *ShellOperator) WithTempDir(dir string)

Jump to

Keyboard shortcuts

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