cli

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidNumProcesses = errors.New("number of processes must be greater than 0")
	ErrInvalidErrorRate    = errors.New("error rate must be between 0 and 100")
	ErrInvalidValueList    = errors.New("value list file does not exist")
	ErrInvalidInput        = errors.New("input must be a directory or a .zst file with RC_ or RS_ prefix")
)

Common validation errors

Functions

func GetContext

func GetContext(deps c.Dependencies, config c.Config) (c.Context, error)

GetContext creates a new application context using the provided dependencies and configuration.

func GetDependencies

func GetDependencies() (c.Dependencies, error)

GetDependencies creates and returns the application dependencies. This function can be expanded to include additional dependencies as needed.

func LoadConfig

func LoadConfig(deps c.Dependencies, configPath string, opts Options) (c.Config, error)

LoadConfig loads the configuration from all sources and returns the merged result.

func ValidateCSVCommand

func ValidateCSVCommand(config *c.Config, deps *c.Dependencies) error

func ValidateCommon

func ValidateCommon(config *c.Config, deps *c.Dependencies) error

func ValidateFilterCommand

func ValidateFilterCommand(config *c.Config, deps *c.Dependencies) error

Types

type ConfigLoader

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

ConfigLoader handles loading and merging configuration from different sources

func NewConfigLoader

func NewConfigLoader(fs afero.Fs) *ConfigLoader

NewConfigLoader creates a new configuration loader

type Options

type Options struct {
	ConfigPath string // Path to configuration file

	// Processing options
	Field     string
	Value     string
	ValueList string
	Threads   int

	// Filter options
	FileFilter        string
	SplitIntermediate bool
	ErrorRate         int
	PartialMatch      bool
	RegexMatch        bool

	Debug bool
}

Options holds CLI flags and configuration options.

Jump to

Keyboard shortcuts

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