yaml

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spec

type Spec struct {
	// Specifies the YAML file
	File string `yaml:",omitempty"`
	// Specifies the YAML key
	Key string `yaml:",omitempty"`
	// Specifies the YAML value
	Value string `yaml:",omitempty"`
	// [condition] allow checking for only the existence of a key (not its value)
	KeyOnly bool `yaml:",omitempty"`
}

Spec defines a specification for a "yaml" resource parsed from an updatecli manifest file

type Yaml

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

Yaml defines a resource of kind "yaml"

func New

func New(spec interface{}) (*Yaml, error)

New returns a reference to a newly initialized Yaml object from a Spec or an error if the provided YamlSpec triggers a validation error.

func (*Yaml) Changelog

func (y *Yaml) Changelog() string

Changelog returns the changelog for this resource, or an empty string if not supported

func (*Yaml) Condition

func (y *Yaml) Condition(source string) (bool, error)

Condition checks if a key exists in a yaml file

func (*Yaml) ConditionFromSCM

func (y *Yaml) ConditionFromSCM(source string, scm scm.ScmHandler) (bool, error)

ConditionFromSCM checks if a key exists in a yaml file

func (*Yaml) Read

func (y *Yaml) Read() error

Read defines CurrentContent to the content of the file which path is specified in Spec.File

func (*Yaml) Source

func (y *Yaml) Source(workingDir string) (string, error)

Source return the latest version

func (*Yaml) Target

func (y *Yaml) Target(source string, dryRun bool) (bool, error)

Target updates a scm repository based on the modified yaml file.

func (*Yaml) TargetFromSCM

func (y *Yaml) TargetFromSCM(source string, scm scm.ScmHandler, dryRun bool) (bool, []string, string, error)

TargetFromSCM updates a scm repository based on the modified yaml file.

func (*Yaml) Validate

func (y *Yaml) Validate() error

Validate validates the object and returns an error (with all the failed validation messages) if it is not valid

Jump to

Keyboard shortcuts

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