controller

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerConfig

type ControllerConfig struct {
	// The name of the controller in kebab case, e.g.
	// kubernetes-runtime-controller
	Name string

	// The name of the controller in kebab case sans "-controler", e.g
	// kubernetes-runtime
	ShortName string

	// The name of the controller in lower case, no spaces, e.g.
	// kubernetesruntime
	PackageName string

	// The name of a NATS Jetstream stream for a controller, e.g.
	// KubernetesRuntimeStreamName
	StreamName string

	// The objects for which reconcilers should be generated.
	ReconciledObjects []ReconciledObject

	// The struct values parsed from the controller's model file.
	// The data model can be interpreted as:
	// map[objectName]map[fieldName]map[tagKey]tagValue
	// An example of this data model with a WorkloadDefinition is:
	// map["WorkloadDefinition"]map["YAMLDocument"]map["validate"]"required"
	StructTags map[string]map[string]map[string]string
}

func (*ControllerConfig) CheckStructTagMap

func (cc *ControllerConfig) CheckStructTagMap(
	object,
	field,
	tagKey,
	expectedTagValue string,
) bool

CheckStructTagMap checks if a struct tag map contains a specific value.

func (*ControllerConfig) ConfigurePullSubscription

func (cc *ControllerConfig) ConfigurePullSubscription(g *jen.Group, durable bool, moduleOverride *string)

ConfigurePullSubscription adds a durable consumer to a controller's main package.

func (*ControllerConfig) ExtensionMainPackage

func (cc *ControllerConfig) ExtensionMainPackage(modulePath string) error

ExtensionMainPackage generates the source code for a controller's main package in an extension.

func (*ControllerConfig) ExtensionReconcilers

func (cc *ControllerConfig) ExtensionReconcilers(modulePath string) error

Reconcilers generates the source code for a controller's reconcile functions in an extension.

func (*ControllerConfig) GetLatestObject

func (cc *ControllerConfig) GetLatestObject(g *jen.Group, obj string, moduleOverride *string)

GetLatestObject generates the source code for a controller's reconcile functions to get the latest object if the "persist" field is not present or set to true.

func (*ControllerConfig) InternalPackage

func (cc *ControllerConfig) InternalPackage() error

InternalPackage generates the controller's general internal package source code.

func (*ControllerConfig) MainPackage

func (cc *ControllerConfig) MainPackage() error

MainPackage generates the source code for a controller's main package.

func (*ControllerConfig) ReconcilerFunctions

func (cc *ControllerConfig) ReconcilerFunctions() error

func (*ControllerConfig) Reconcilers

func (cc *ControllerConfig) Reconcilers() error

Reconcilers generates the source code for a controller's reconcile functions.

type ReconciledObject

type ReconciledObject struct {
	Name                           string
	Version                        string
	DisableNotificationPersistence bool
}

ReconciledObject is a struct that contains the name and version of a reconciled object.

Jump to

Keyboard shortcuts

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