sharedconfig

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatJSON = "json"
	FormatText = "text"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FormatConfig

type FormatConfig struct {
	Output string `koanf:"output" short:"o" description:"output format, one of 'json' or 'text'"`
}

func NewFormatConfig

func NewFormatConfig() FormatConfig

func (*FormatConfig) Print

func (cfg *FormatConfig) Print(cmd *cobra.Command, a any) error

func (*FormatConfig) Validate

func (cfg *FormatConfig) Validate() error

type WalkConfig

type WalkConfig struct {
	SearchDir       string         `koanf:"search.dir" short:"d" description:"directory to search for files recursively"`
	FileRegex       string         `koanf:"file.regex" short:"f" description:"regex to match files in the search dir"`
	FileRegexp      *regexp.Regexp `koanf:"-"`
	ArchiveRegex    string         `koanf:"archive.regex" short:"a" description:"regex to match archive files in the search dir"`
	ArchiveRegexp   *regexp.Regexp `koanf:"-"`
	IncludeArchives bool           `koanf:"include.archive" short:"A" description:"search inside archive files"`
	Concurrency     int            `koanf:"concurrency" short:"t" description:"number of concurrent workers to use"`
}

func NewWalkConfig

func NewWalkConfig() WalkConfig

func (*WalkConfig) ToFSWalkConfig

func (cfg *WalkConfig) ToFSWalkConfig() fswalk.WalkConfig

func (*WalkConfig) Validate

func (cfg *WalkConfig) Validate() error

Jump to

Keyboard shortcuts

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