rulesextractor

package
v0.29.4-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrReadingRulesFile = errors.New("error while reading rules file")

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

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

func (*BaseExtractor) UnsupportedReducerRulesByDiffs

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

type DistroExtractor

type DistroExtractor struct {
	*BaseExtractor
	Spec Spec
}

func NewDistroClusterRulesExtractor

func NewDistroClusterRulesExtractor(distributionPath string) (*DistroExtractor, error)

func (*DistroExtractor) GetImmutables

func (r *DistroExtractor) GetImmutables(phase string) []string

func (*DistroExtractor) GetReducers

func (r *DistroExtractor) GetReducers(phase string) []Rule

func (*DistroExtractor) ReducerRulesByDiffs

func (r *DistroExtractor) ReducerRulesByDiffs(rls []Rule, ds diff.Changelog) []Rule

func (*DistroExtractor) UnsafeReducerRulesByDiffs

func (r *DistroExtractor) UnsafeReducerRulesByDiffs(rls []Rule, ds diff.Changelog) []Rule

func (*DistroExtractor) UnsupportedReducerRulesByDiffs

func (r *DistroExtractor) UnsupportedReducerRulesByDiffs(rls []Rule, ds diff.Changelog) []Rule

type EKSExtractor

type EKSExtractor struct {
	*BaseExtractor
	Spec Spec
}

func NewEKSClusterRulesExtractor

func NewEKSClusterRulesExtractor(distributionPath string) (*EKSExtractor, error)

func (*EKSExtractor) GetImmutables

func (r *EKSExtractor) GetImmutables(phase string) []string

func (*EKSExtractor) GetReducers

func (r *EKSExtractor) GetReducers(phase string) []Rule

func (*EKSExtractor) ReducerRulesByDiffs

func (r *EKSExtractor) ReducerRulesByDiffs(rls []Rule, ds diff.Changelog) []Rule

func (*EKSExtractor) UnsafeReducerRulesByDiffs

func (r *EKSExtractor) UnsafeReducerRulesByDiffs(rls []Rule, ds diff.Changelog) []Rule

func (*EKSExtractor) UnsupportedReducerRulesByDiffs

func (r *EKSExtractor) UnsupportedReducerRulesByDiffs(rls []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 OnPremExtractor

type OnPremExtractor struct {
	*BaseExtractor
	Spec Spec
}

func NewOnPremClusterRulesExtractor

func NewOnPremClusterRulesExtractor(distributionPath string) (*OnPremExtractor, error)

func (*OnPremExtractor) GetImmutables

func (r *OnPremExtractor) GetImmutables(phase string) []string

func (*OnPremExtractor) GetReducers

func (r *OnPremExtractor) GetReducers(phase string) []Rule

func (*OnPremExtractor) ReducerRulesByDiffs

func (r *OnPremExtractor) ReducerRulesByDiffs(rls []Rule, ds diff.Changelog) []Rule

func (*OnPremExtractor) UnsafeReducerRulesByDiffs

func (r *OnPremExtractor) UnsafeReducerRulesByDiffs(rls []Rule, ds diff.Changelog) []Rule

func (*OnPremExtractor) UnsupportedReducerRulesByDiffs

func (r *OnPremExtractor) UnsupportedReducerRulesByDiffs(rls []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

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