toolversions

package
v0.86.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrToolVersionsFailedParsingByteFormat is returned if tool-versions couldn't parse the byteData
	ErrToolVersionsFailedParsingByteFormat error = errors.New("failed to parse file")
)

Functions

func JoinPathWithWorkingDirectoryPath

func JoinPathWithWorkingDirectoryPath(fileName, workingDir string) string

joinPathwithworkingDirectoryPath To merge File path with current working dire, unless file is an http url

Types

type Entry

type Entry struct {
	Key   string
	Value string
}

Entry represents a key-value pair in the .tool-versions file.

type FileContent

type FileContent struct {
	// FilePath defines the fullpath filename
	FilePath string
	// ContentRetriever is an interface to manipulate raw files
	ContentRetriever text.TextRetriever
	// Entries contains the .tool-versions representation of the file
	Entries []Entry
}

func (*FileContent) Get

func (f *FileContent) Get(key string) (string, error)

Query returns the value for a specific value from a .tool-versions file

func (*FileContent) Put

func (f *FileContent) Put(key, value string) error

Put inserts or updates a key-value pair in the .tool-versions file

func (*FileContent) Read

func (f *FileContent) Read(rootDir string) error

Read reads the content of a file after runtime validation

func (*FileContent) Write

func (f *FileContent) Write() error

Jump to

Keyboard shortcuts

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