app

package
v0.0.0-...-9428abd Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 21 Imported by: 1

README

App

Common bootstrap logic setting up controllers, wiring dependencies and running main loop.

Usage

PipelinesFeedbackApp is using a Dependency Injection (Constructor Injection) pattern to let your controller be configured with implementations of choice. Replace any piece by simply injecting it in the object construction.

pfcApp := app.PipelinesFeedbackApp{
    JobController:    batchjob.CreateJobController(),
    ConfigController: &controller.ConfigurationController{},
}
// Interface definition
type PipelinesFeedbackApp struct {
	// can read configuration from various sources
	ConfigCollector config.ConfigurationCollector

	JobController          *controller.GenericController
	ConfigController       *controller.ConfigurationController

	CustomFeedbackReceiver string
	CustomConfigCollector  string

	// Feedback receivers available to choose by the user. Falls back to default, embedded list if not specified
	AvailableFeedbackReceivers []feedback.Receiver

	// Config providers available to choose by the user. Falls back to default, embedded list if not specified
	AvailableConfigCollectors []config.ConfigurationCollector
}

Building your own controller application

Copy main.go to your project and adjust to your needs, then use go build to build a customized controller. In order to implement other kind (CRD) inject your implementation to the JobController - check example for BatchV1Job.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PipelinesFeedbackApp

type PipelinesFeedbackApp struct {
	// can read configuration from various sources
	ConfigCollector config.ConfigurationCollector

	JobController          *controller.GenericController
	ConfigController       *controller.ConfigurationController
	Debug                  bool
	DisableCRD             bool
	ControllerName         string
	MetricsBindAddress     string
	HealthProbeBindAddress string
	LeaderElect            bool
	LeaderElectId          string
	RestrictNamespaces     string

	CustomFeedbackReceiver string
	CustomStore            string
	CustomConfigCollector  string

	// error handling
	DelayAfterErrorNum          int
	RequeueDelaySecs            int
	StopProcessingAfterErrorNum int

	// Feedback receivers available to choose by the user. Falls back to default, embedded list if not specified
	AvailableFeedbackReceivers []feedback.Receiver

	// Stores available to pick by the user
	AvailableStores []store.Store

	// Config providers available to choose by the user. Falls back to default, embedded list if not specified
	AvailableConfigCollectors []config.ConfigurationCollector

	// Allows to register custom CRD schema for the controller
	KubernetesSchemeSetters []SchemeSetter

	Logger *logging.InternalLogger
	// contains filtered or unexported fields
}

func (*PipelinesFeedbackApp) Run

func (app *PipelinesFeedbackApp) Run() error

type SchemeSetter

type SchemeSetter func(*runtime.Scheme) error

Jump to

Keyboard shortcuts

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