toolversions

package
v0.80.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSpecFileUndefined is returned if a file wasn't specified
	ErrSpecFileUndefined = errors.New(".tool-versions file undefined")
	// ErrSpecKeyUndefined is returned if a key wasn't specified
	ErrSpecKeyUndefined = errors.New("tool-versions key undefined")
	// ErrSpecFileAndFilesDefines when we both spec File and Files have been specified
	ErrSpecFileAndFilesDefined = errors.New("parameter \"file\" and \"files\" are mutually exclusive")
	// ErrWrongSpec is returned when the Spec has wrong content
	ErrWrongSpec error = errors.New("wrong spec content")
)
View Source
var (
	// ErrDaselFailedParsingToolsVersionsByteFormat is returned if dasel couldn't parse the byteData
	ErrDaselFailedParsingToolsVersionsByteFormat error = errors.New("fail to parse .tool-versions data")
)

Functions

This section is empty.

Types

type Spec

type Spec struct {
	// [s][c][t] File specifies the .tool-versions file to manipulate
	File string `yaml:",omitempty"`
	// [c][t] Files specifies a list of .tool-versions file to manipulate
	Files []string `yaml:",omitempty"`
	// [s][c][t] Key specifies the query to retrieve an information from a .tool-versions file
	Key string `yaml:",omitempty"`
	// [s][c][t] Value specifies the value for a specific key. Default to source output
	Value string `yaml:",omitempty"`
	/*
	  [t] CreateMissingKey allows non-existing keys. If the key does not exist, the key is created if AllowsMissingKey
	  is true, otherwise an error is raised (the default).
	  Only supported if Key is used
	*/
	CreateMissingKey bool `yaml:",omitempty"`
}

func (*Spec) Validate

func (s *Spec) Validate() error

type ToolVersions

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

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

func New

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

func (*ToolVersions) Changelog

func (t *ToolVersions) Changelog() string

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

func (*ToolVersions) Condition

func (t *ToolVersions) Condition(source string, scm scm.ScmHandler) (pass bool, message string, err error)

func (*ToolVersions) Source

func (t *ToolVersions) Source(workingDir string, resultSource *result.Source) error

func (*ToolVersions) Target

func (t *ToolVersions) Target(source string, scm scm.ScmHandler, dryRun bool, resultTarget *result.Target) error

Jump to

Keyboard shortcuts

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