processor

package
v0.0.0-...-fa316b3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package processor contains an interface for all processing and implementations of the processors which mangle the yaml

Index

Constants

This section is empty.

Variables

View Source
var ErrDisabledProcessor = errors.New("internal Error: attempt to use disabled processor")

ErrDisabledProcessor is the error to return when attempting to use a disabled processor

Functions

func MergeYaml

func MergeYaml(path string, mergetext string, patchtext string) error

MergeYaml performs a json patch and a strategic merge, both if needed to some yaml on disk Performs the strategic merge FIRST, followed by the json patch. This is supposed to be Kubernetes strategic merge and RFC6902 patching Accepts these patches as yaml. Will write a file to disk from these if the file does not already exist, strategic merge patching an on disk file will effectively create it.

Types

type Dependencies

type Dependencies struct {
	Dependencies []Dependency `yaml:"dependencies"`
}

Dependencies is a list of repositories that this chart is dependent upon

type Dependency

type Dependency struct {
	Name       string `yaml:"name"`
	Repository string `yaml:"repository"`
}

Dependency is one repository that this chart is dependent upon

type HelmProcessor

type HelmProcessor struct{}

HelmProcessor handles Chart,yaml files via helm

func (HelmProcessor) Enabled

func (HelmProcessor) Enabled(_ string, path string) bool

Enabled returns true only if this proessor can do work

func (HelmProcessor) Generate

func (h HelmProcessor) Generate(input *string, basePath string, path string) (*string, error)

Generate create the text stream for this plugin

func (HelmProcessor) Name

func (HelmProcessor) Name() string

Name returns a string for the plugin's name

type HelmfileProcessor

type HelmfileProcessor struct{}

HelmfileProcessor handles Chart,yaml files via helm

func (HelmfileProcessor) Enabled

func (HelmfileProcessor) Enabled(_ string, path string) bool

Enabled returns true only if this proessor can do work

func (HelmfileProcessor) Generate

func (h HelmfileProcessor) Generate(input *string, basePath string, path string) (*string, error)

Generate create the text stream for this plugin

func (HelmfileProcessor) Name

func (HelmfileProcessor) Name() string

Name returns a string for the plugin's name

type KustomizeProcessor

type KustomizeProcessor struct{}

KustomizeProcessor handles kustomization.yaml via kustomize

func (KustomizeProcessor) Enabled

func (KustomizeProcessor) Enabled(_ string, path string) bool

Enabled returns true only if this proessor can do work

func (KustomizeProcessor) Generate

func (k KustomizeProcessor) Generate(input *string, basePath string, path string) (*string, error)

Generate create the text stream for this plugin

func (KustomizeProcessor) Name

func (KustomizeProcessor) Name() string

Name returns a string for the plugin's name

type PluginProcessor

type PluginProcessor struct{}

PluginProcessor runs post processing plugins on a stream of yaml text

func (PluginProcessor) Enabled

func (PluginProcessor) Enabled(basePath string, path string) bool

Enabled returns true only if this proessor can do work

func (PluginProcessor) Generate

func (v PluginProcessor) Generate(input *string, basePath string, path string) (*string, error)

Generate create the text stream for this plugin

func (PluginProcessor) Name

func (PluginProcessor) Name() string

Name returns a string for the plugin's name

type PreProcessor

type PreProcessor struct{}

PreProcessor is not a strict processor, as it handles files on disk

func (PreProcessor) Enabled

func (PreProcessor) Enabled(basePath string, path string) bool

Enabled returns true only if this proessor can do work

func (PreProcessor) Generate

func (v PreProcessor) Generate(basePath string, path string) error

Generate create the text stream for this plugin

func (PreProcessor) Name

func (PreProcessor) Name() string

Name returns a string for the plugin's name

type Processor

type Processor interface {
	Name() string
	Enabled(basePath string, path string) bool
	Generate(input *string, basePath string, path string) (*string, error)
}

Processor interface is the interface for all processing engines name - name of processor for display and selection purposes enabled - does this processor believe it has work to do generate - call this to invoke main phase on this processor Historically we had an init phase, which has been removed

type YamlProcessor

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

YamlProcessor is the fallback processor for gathering plain yaml files

func (YamlProcessor) Enabled

func (YamlProcessor) Enabled(_ string, _ string) bool

Enabled returns true only if this proessor can do work

func (YamlProcessor) Generate

func (y YamlProcessor) Generate(input *string, basePath string, path string) (*string, error)

Generate create the text stream for this plugin

func (YamlProcessor) Name

func (YamlProcessor) Name() string

Name returns a string for the plugin's name

Jump to

Keyboard shortcuts

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