Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register[T Constraint](applier Applier[T])
Register generically registers an Applier.
func RegisterSet ¶
func RegisterSet(set ApplierSet)
RegisterSet registers each of the Appliers contained in the set.
Types ¶
type Applier ¶
type Applier[T Constraint] interface { Apply(*T) }
Applier is the interface which applies a manipulation to the PodOption to be used to run ephemeral pdos.
type ApplierFunc ¶
type ApplierFunc[T Constraint] func(*T)
ApplierFunc is a function which implements the Applier interface and can be used to generically manipulate the PodOptions.
func (ApplierFunc[T]) Apply ¶
func (f ApplierFunc[T]) Apply(options *T)
type ApplierList ¶
type ApplierList[T Constraint] []Applier[T]
ApplierList is an array of registered Appliers which will be applied on a PodOption.
var ( Container ApplierList[corev1.Container] PodOptions ApplierList[kube.PodOptions] )
func (ApplierList[T]) Apply ¶
func (l ApplierList[T]) Apply(options *T)
Apply calls the Applier::Apply method on all registered appliers.
func (*ApplierList[T]) Register ¶
func (l *ApplierList[T]) Register(applier Applier[T])
Register adds the applier to the list of Appliers to be used when manipulating the PodOptions.
type ApplierSet ¶
ApplierSet is a group of Appliers, typically returned by a constructor.
func OSEnvVar ¶
func OSEnvVar(name string) ApplierSet
OSEnvVar creates an ApplierSet to set an environment variable if it's present in the current environment.
func StaticEnvVar ¶
func StaticEnvVar(name, value string) ApplierSet
StaticEnvVar creates an ApplierSet to set a static environment variable.
type Constraint ¶
type Constraint interface { kube.PodOptions | corev1.Container }
Constraint provides the set of types allowed for appliers and filterers.
type ContainerNameFilter ¶
type ContainerNameFilter string
ContainerNameFilter is a Filterer that filters based on the Container.Name.
type Filterer ¶
type Filterer[T Constraint] interface { Filter(*T) bool }
Filterer is the interface which filters the use of registered appliers to only those PodOptions that match the filter criteria.
type FiltererFunc ¶
type FiltererFunc[T Constraint] func(*T) bool
FiltererFunc is a function which implements the Filterer interface and can be used to generically filter PodOptions to manipulate using the ApplierList.
func (FiltererFunc[T]) Filter ¶
func (f FiltererFunc[T]) Filter(options *T) bool
type PodOptionsNameFilter ¶
type PodOptionsNameFilter string
PodOptionsNameFilter is a Filterer that filters based on the PodOptions.Name which is the Pod name.
func (PodOptionsNameFilter) Filter ¶
func (n PodOptionsNameFilter) Filter(options *kube.PodOptions) bool