xml

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSpecFileUndefined = errors.New("xml file not specified")
	ErrSpecKeyUndefined  = errors.New("xml key undefined")
)
View Source
var (
	// ErrWrongSpec is returned when the Spec has wrong content
	ErrWrongSpec error = errors.New("wrong spec content")
)

Functions

This section is empty.

Types

type Spec

type Spec struct {
	// [s][c][t] File defines the xml path to interact with
	File string `yaml:",omitempty"`
	// [s][c][t] Path defines the xmlPAth used for doing the query
	Path string `yaml:",omitempty"`
	// [s][c][t] Value specifies the value for a specific Path. Default value fetch from source input
	Value string `yaml:",omitempty"`
}

func (*Spec) Validate

func (s *Spec) Validate() (errs []error)

type XML

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

XML stores configuration about the file and the key value which needs to be updated.

func New

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

func (*XML) Changelog

func (x *XML) Changelog() string

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

func (*XML) Condition

func (x *XML) Condition(source string) (bool, error)

func (*XML) ConditionFromSCM

func (x *XML) ConditionFromSCM(source string, scm scm.ScmHandler) (bool, error)

func (*XML) Read added in v0.33.1

func (x *XML) Read() error

func (*XML) Source

func (x *XML) Source(workingDir string) (string, error)

func (*XML) Target

func (x *XML) Target(source string, dryRun bool) (changed bool, err error)

func (*XML) TargetFromSCM

func (x *XML) TargetFromSCM(source string, scm scm.ScmHandler, dryRun bool) (changed bool, files []string, message string, err error)

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

func (*XML) Validate

func (x *XML) Validate() (err error)

Jump to

Keyboard shortcuts

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