pr

package
v0.12.69 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 29 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ListMergeAppend    = "APPEND"
	ListMergeOverwrite = "OVERWRITE"
)

Variables

This section is empty.

Functions

func Apply

func Apply(template *PrTemplate) error

Types

type AutomationContract

type AutomationContract struct {
	File        string `json:"file"`
	ExternalDir string `json:"externalDir,omitempty"`
	Context     string `json:"context"`
}

type CreateSpec

type CreateSpec struct {
	ExternalDir string
	Templates   []*CreateTemplate `json:"templates"`
}

type CreateTemplate

type CreateTemplate struct {
	Source      string                 `json:"source"`
	Destination string                 `json:"destination"`
	External    bool                   `json:"external"`
	Context     map[string]interface{} `json:"context,omitempty"`
	Condition   string                 `json:"condition"`
}

type DeleteSpec

type DeleteSpec struct {
	Files   []string `json:"files"`
	Folders []string `json:"folders"`
}

type Helm

type Helm struct {
	// The url of the helm repository to use
	URL string `json:"url"`

	// The name of the chart to use
	Chart string `json:"chart"`

	// The version of the chart to use
	Version string `json:"version"`

	// The directory destination to place the chart in
	Destination string `json:"destination"`
}

type ListMerge

type ListMerge string

type LuaSpec

type LuaSpec struct {
	ExternalDir string `json:"externalDir"`
	External    bool   `json:"external"`
	Script      string `json:"script"`
	Folder      string `json:"folder"`
}

type PrContracts

type PrContracts struct {
	ApiVersion string                 `json:"apiVersion"`
	Kind       string                 `json:"kind"`
	Metadata   map[string]interface{} `json:"metadata"`
	Context    map[string]interface{} `json:"context"`
	Spec       PrContractsSpec        `json:"spec"`
}

func BuildContracts

func BuildContracts(path string) (*PrContracts, error)

type PrContractsSpec

type PrContractsSpec struct {
	Templates   *TemplateCopy        `json:"templates"`
	Workdir     string               `json:"workdir,omitempty"`
	Automations []AutomationContract `json:"automations"`
}

type PrTemplate

type PrTemplate struct {
	ApiVersion string                 `json:"apiVersion"`
	Kind       string                 `json:"kind"`
	Metadata   map[string]interface{} `json:"metadata"`
	Context    map[string]interface{} `json:"context"`
	Spec       PrTemplateSpec         `json:"spec"`
}

func Build

func Build(path string) (*PrTemplate, error)

func BuildCRD

func BuildCRD(path, contextFile string) (*PrTemplate, error)

type PrTemplateSpec

type PrTemplateSpec struct {
	Updates *UpdateSpec `json:"updates"`
	Creates *CreateSpec `json:"creates"`
	Deletes *DeleteSpec `json:"deletes"`
	Lua     *LuaSpec    `json:"lua"`
	Vendor  *VendorSpec `json:"vendor"`
}

type RegexReplacement

type RegexReplacement struct {
	Regex       string `json:"regex"`
	Replacement string `json:"replacement"`
	File        string `json:"file"`
	Templated   bool   `json:"templated"`
}

type TemplateCopy

type TemplateCopy struct {
	From string `json:"from"`
	To   string `json:"to"`
}

type UpdateSpec

type UpdateSpec struct {
	Regexes           []string           `json:"regexes"`
	Files             []string           `json:"files"`
	ReplaceTemplate   string             `json:"replaceTemplate"`
	Yq                string             `json:"yq"`
	MatchStrategy     string             `json:"matchStrategy"`
	RegexReplacements []RegexReplacement `json:"regexReplacements"`
	YamlOverlays      []YamlOverlay      `json:"yamlOverlays"`
}

type VendorSpec

type VendorSpec struct {
	// Specification for vendoring a helm chart
	Helm *Helm `json:"helm"`
}

type YamlOverlay

type YamlOverlay struct {
	File      string    `json:"file"`
	Yaml      string    `json:"yaml"`
	ListMerge ListMerge `json:"listMerge"`
	Templated bool      `json:"templated"`
}

Jump to

Keyboard shortcuts

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