inputs

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ID added in v0.24.0

func ID(s string) string

ID returns a short, opaque ID for input sets.

func JSON added in v0.29.0

func JSON(v any) (*apiextensionsv1.JSON, error)

JSON returns the Kubernetes API JSON representation of any value.

Types

type Combined added in v0.29.0

type Combined []combinedSet

Combined is a type for functions that expect a list of input sets that have already been combined according to an input strategy. The type is to emphasize this expectation for callers, e.g. builder.BuildResourceSet().

func Combine added in v0.29.0

func Combine(rset *fluxcdv1.ResourceSet, providerMap map[ProviderKey]fluxcdv1.InputProvider) (Combined, error)

Combine combines the inputs from the given ResourceSet and the given map of input providers according to the input strategy defined in the ResourceSet spec.

func ToCombined added in v0.29.0

func ToCombined(inps []map[string]any) Combined

ToCombined converts a slice of maps to the Combined type.

type Flattener added in v0.29.0

type Flattener struct {
	// contains filtered or unexported fields
}

Flattener is a strategy that flattens the inputs from multiple providers into a single list by concatenating them.

func NewFlattener added in v0.29.0

func NewFlattener() *Flattener

NewFlattener returns a new initialized *Flattener.

func (*Flattener) AddProvider added in v0.29.0

func (f *Flattener) AddProvider(name string, inputs []map[string]any) error

AddProvider adds the inputs from a provider to the flattener.

func (*Flattener) Combine added in v0.29.0

func (f *Flattener) Combine() Combined

Combine returns the combined inputs as a single flattened list.

type NormalizedKey added in v0.29.0

type NormalizedKey string

NormalizedKey is a type alias for string that represents a normalized key for use in templates.

func NormalizeKeyForTemplate added in v0.29.0

func NormalizeKeyForTemplate(key string) NormalizedKey

NormalizeKeyForTemplate normalizes the given string to a consistent format for use as a key in maps fed to Go templates.

We convert uppercase letters to lowercase, replace spaces and punctuation with '_', and remove any characters not in [a-z0-9_]. Then we split the words by '_' and join only the resulting non-empty words back together with '_'.

type Permuter added in v0.29.0

type Permuter struct {
	// contains filtered or unexported fields
}

Permuter accumulates a series of input provider objects and their respective list of exported inputs and generates the permutation L_1 x L_2 x ... x L_n, where L_i is the list of inputs exported by the i-th provider.

func NewPermuter added in v0.29.0

func NewPermuter(opts ...PermuterOption) *Permuter

NewPermuter returns a new initialized *Permuter.

func (*Permuter) AddProvider added in v0.29.0

func (p *Permuter) AddProvider(providerName string, providerInputs []map[string]any) error

AddProvider accumulates the given input provider object and its exported inputs. If permutations have already been generated, the state is not mutated.

func (*Permuter) Combine added in v0.29.0

func (p *Permuter) Combine() Combined

Combine generates the permutations of the inputs exported by the accumulated list of input provider objects and their exported inputs.

type PermuterOption added in v0.29.0

type PermuterOption func(*Permuter)

PermuterOption is a functional option for configuring the Permuter.

func WithIncludeEmptyProviders added in v0.29.0

func WithIncludeEmptyProviders() PermuterOption

WithIncludeEmptyProviders configures the Permuter to include input providers that do not export any inputs when generating permutations. This allows generating an empty permutation when at least one provider has no inputs.

type ProviderKey

type ProviderKey struct {
	GVK       schema.GroupVersionKind
	Name      string
	Namespace string
}

ProviderKey is the key used to identify input providers.

func NewProviderKey

func NewProviderKey(provider fluxcdv1.InputProvider) ProviderKey

NewProviderKey returns the key for the input provider.

Jump to

Keyboard shortcuts

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