pr

package
v0.9.19 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(template *PrTemplate) error

Types

type AutomationContract added in v0.9.16

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 added in v0.8.4

type CreateTemplate struct {
	Source      string `json:"source"`
	Destination string `json:"destination"`
	External    bool   `json:"external"`
}

type DeleteSpec added in v0.9.11

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

type PrContracts added in v0.9.16

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 added in v0.9.16

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

type PrContractsSpec added in v0.9.16

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 added in v0.9.16

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

type PrTemplateSpec

type PrTemplateSpec struct {
	Updates *UpdateSpec `json:"updates"`
	Creates *CreateSpec `json:"creates"`
	Deletes *DeleteSpec `json:"deletes"`
}

type RegexReplacement added in v0.8.6

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

type TemplateCopy added in v0.9.16

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:"replace_template"`
	Yq                string             `json:"yq"`
	MatchStrategy     string             `json:"match_strategy"`
	RegexReplacements []RegexReplacement `json:"regex_replacements"`
}

Jump to

Keyboard shortcuts

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