controllername

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(firstWord string, additionalWords ...string) controllerName

New returns a new controllerName after taking each word of the controller name as a separate argument

Types

type ControllerNamer

type ControllerNamer interface {
	// String returns the name of the controller in a human-readable form
	String() string
	// MetricsName returns the name of the controller in a form that can be used for Prometheus metrics, specifically as a Prometheus label https://prometheus.io/docs/practices/naming/#labels
	MetricsName() string
	// LoggerName returns the name of the controller in a form that can be used for logr logger naming
	LoggerName() string
	// AddToLogger adds controller name fields to the logger then returns the logger with the added fields
	AddToLogger(l logr.Logger) logr.Logger
	// AddToController adds the controller name to the controller builder then returns the builder with the added name. This is useful for naming managed controllers from controller-runtime
	AddToController(blder *builder.Builder, l logr.Logger) *builder.Builder
}

ControllerNamer is an interface that returns the name of the controller in all necessary forms

Jump to

Keyboard shortcuts

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