ephemeral

package
v0.113.0-alpha.1 Latest Latest
Warning

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

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

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.

func Filter

func Filter[T Constraint](filterer Filterer[T], appliers ...Applier[T]) Applier[T]

Filter applies the Appliers if the Filterer criterion is met.

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

type ApplierSet struct {
	Container  Applier[corev1.Container]
	PodOptions Applier[kube.PodOptions]
}

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.

func (ContainerNameFilter) Filter

func (n ContainerNameFilter) Filter(container *corev1.Container) bool

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

Jump to

Keyboard shortcuts

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