rules

package
v0.29.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseExtractor

type BaseExtractor struct {
	Spec Spec
}

func NewBaseExtractor

func NewBaseExtractor(spec Spec) *BaseExtractor

func (*BaseExtractor) ExtractImmutablesFromRules

func (*BaseExtractor) ExtractImmutablesFromRules(rls []Rule) []string

func (*BaseExtractor) ExtractReducerRules

func (*BaseExtractor) ExtractReducerRules(rls []Rule) []Rule

func (*BaseExtractor) GetImmutables

func (b *BaseExtractor) GetImmutables(_ string) []string

func (*BaseExtractor) GetReducers

func (b *BaseExtractor) GetReducers(_ string) []Rule

func (*BaseExtractor) ReducerRulesByDiffs

func (*BaseExtractor) ReducerRulesByDiffs(rules []Rule, ds diff.Changelog) []Rule

func (*BaseExtractor) UnsafeReducerRulesByDiffs added in v0.27.2

func (b *BaseExtractor) UnsafeReducerRulesByDiffs(rules []Rule, ds diff.Changelog) []Rule

func (*BaseExtractor) UnsupportedReducerRulesByDiffs

func (b *BaseExtractor) UnsupportedReducerRulesByDiffs(rules []Rule, ds diff.Changelog) []Rule

type Extractor

type Extractor interface {
	GetImmutables(phase string) []string
	GetReducers(phase string) []Rule
	ReducerRulesByDiffs(reducers []Rule, ds diff.Changelog) []Rule
	UnsupportedReducerRulesByDiffs(rules []Rule, ds diff.Changelog) []Rule
	UnsafeReducerRulesByDiffs(rules []Rule, ds diff.Changelog) []Rule
}

type Reducer

type Reducer struct {
	Key       string `yaml:"key"`
	Lifecycle string `yaml:"lifecycle"`
	From      any    `yaml:"from"`
	To        any    `yaml:"to"`
}

type Rule

type Rule struct {
	Path        string         `yaml:"path"`
	Immutable   bool           `yaml:"immutable"`
	Description *string        `yaml:"description,omitempty"`
	Unsupported *[]Unsupported `yaml:"unsupported,omitempty"`
	Safe        *[]Safe        `yaml:"safe,omitempty"`
	Reducers    *[]Reducer     `yaml:"reducers,omitempty"`
}

type Safe added in v0.27.2

type Safe struct {
	From *any `yaml:"from,omitempty"`
	To   *any `yaml:"to,omitempty"`
}

type Spec

type Spec struct {
	Infrastructure *[]Rule `yaml:"infrastructure,omitempty"`
	Kubernetes     *[]Rule `yaml:"kubernetes,omitempty"`
	Distribution   *[]Rule `yaml:"distribution,omitempty"`
}

type Unsupported

type Unsupported struct {
	From   *any    `yaml:"from,omitempty"`
	To     *any    `yaml:"to,omitempty"`
	Reason *string `yaml:"reason,omitempty"`
}

Jump to

Keyboard shortcuts

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