utils

package
v0.0.9-beta Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(path string) bool

FileExists checks if a file exists at the given path.

func LoadDotEnv

func LoadDotEnv(path file.File) error

LoadDotEnv loads environment variables from a .env file.

func LoadTools

func LoadTools(path file.File, log *logger.Logger) (tools.Tools, error)

LoadTools loads the tools configuration.

func Print

func Print(format string, cfg ...any)

Print displays the configuration in the specified format.

func PrintYAMLBytes

func PrintYAMLBytes(yamlBytes []byte) any

PrintYAMLBytes parses YAML bytes into a generic data structure.

func SplitTags

func SplitTags(tags []string) ([]string, []string)

SplitTags splits tags into include and exclude lists.

func ValidateInput

func ValidateInput(toolsPath *string, args []string) error

ValidateInput validates the command-line arguments.

Types

type DefaultEnvironmentLoader

type DefaultEnvironmentLoader struct{}

DefaultEnvironmentLoader is the default implementation of EnvironmentLoader.

func (*DefaultEnvironmentLoader) LoadFromDotEnv

func (l *DefaultEnvironmentLoader) LoadFromDotEnv(path string) error

LoadFromDotEnv loads environment variables from a .env file.

type DefaultFileChecker

type DefaultFileChecker struct{}

DefaultFileChecker is the default implementation of FileChecker.

func (*DefaultFileChecker) Exists

func (c *DefaultFileChecker) Exists(path string) bool

Exists checks if a file exists at the given path.

type DefaultInputValidator

type DefaultInputValidator struct{}

DefaultInputValidator is the default implementation of InputValidator.

func (*DefaultInputValidator) ValidateInput

func (v *DefaultInputValidator) ValidateInput(toolsPath *string, args []string) error

ValidateInput validates the command-line arguments.

type DefaultTagSplitter

type DefaultTagSplitter struct{}

DefaultTagSplitter is the default implementation of TagSplitter.

func (*DefaultTagSplitter) Split

func (s *DefaultTagSplitter) Split(tags []string) ([]string, []string)

Split splits tags into include and exclude lists.

type DefaultToolsLoader

type DefaultToolsLoader struct{}

DefaultToolsLoader is the default implementation of ToolsLoader.

func (*DefaultToolsLoader) LoadTools

func (l *DefaultToolsLoader) LoadTools(path string, log *logger.Logger) (tools.Tools, error)

LoadTools loads the tools configuration.

type DefaultYAMLParser

type DefaultYAMLParser struct{}

DefaultYAMLParser is the default implementation of YAMLParser.

func (*DefaultYAMLParser) ParseBytes

func (p *DefaultYAMLParser) ParseBytes(yamlBytes []byte) any

ParseBytes parses YAML bytes into a generic data structure.

type EnvironmentLoader

type EnvironmentLoader interface {
	LoadFromDotEnv(path string) error
}

EnvironmentLoader loads environment variables from various sources.

type FileChecker

type FileChecker interface {
	Exists(path string) bool
}

FileChecker checks if a file exists.

type InputValidator

type InputValidator interface {
	ValidateInput(toolsPath *string, args []string) error
}

InputValidator validates command-line arguments.

type TagSplitter

type TagSplitter interface {
	Split(tags []string) (include, exclude []string)
}

TagSplitter splits tags into include and exclude lists.

type ToolsLoader

type ToolsLoader interface {
	LoadTools(path string, log *logger.Logger) (tools.Tools, error)
}

ToolsLoader loads tools configuration from a file.

type YAMLParser

type YAMLParser interface {
	ParseBytes(yamlBytes []byte) any
}

YAMLParser parses YAML data.

Jump to

Keyboard shortcuts

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