Documentation
¶
Index ¶
- Constants
- Variables
- func DescribeSourceUsage() string
- func IsStdinSource(s iox.Source) bool
- func NewIndexSource(v string) (iox.Source, error)
- func NewPathSource(v string) (iox.Walker, iox.Source, error)
- func NewQuerySource(v string) (iox.Source, error)
- func NewSource(v string) (iox.Source, error)
- func NewSourceOrRaw(v string) (iox.Source, error)
- func ReadInputFromSource(s iox.Source, noValidate bool) iter.Seq[*node.Node]
- func ReadInputFromWalker(w iox.Walker) iter.Seq[*node.Node]
- type Config
- type Mode
- type Sources
Constants ¶
View Source
const ( StringModeUnknown = "unknown" StringModeVersion = "version" StringModeQuery = "query" StringModeDryrun = "dryrun" StringModeList = "list" )
View Source
const ( ModeUnknown = Mode(StringModeUnknown) ModeVersion = Mode(StringModeVersion) ModeQuery = Mode(StringModeQuery) ModeDryrun = Mode(StringModeDryrun) ModeList = Mode(StringModeList) )
Variables ¶
View Source
var ( ErrInvalidSource = errors.New("InvalidSource") ErrInvalidQuery = errors.New("InvalidQuery") ErrStdinConflict = errors.New("StdinConflict") ErrInvalidInput = errors.New("InvalidInput") ErrNoSources = errors.New("NoSources") )
View Source
var ErrUnknownMode = errors.New("UnknownMode")
Functions ¶
func DescribeSourceUsage ¶
func DescribeSourceUsage() string
func IsStdinSource ¶
func ReadInputFromSource ¶
Types ¶
type Config ¶
type Config struct {
Debug bool `name:"debug" usage:"enable debug logs"`
Trace bool `name:"trace" usage:"enable trace logs"`
Verbose bool `name:"verbose" short:"v" usage:"enable verbose output"`
Index string `name:"index" short:"i" usage:"index source; exclusive with paths"`
RawOutput bool `name:"raw" usage:"enable raw output"`
Mode Mode `name:"-"`
Query string `name:"-"`
Path string `name:"-"`
Args []string `name:"-"`
Stdout io.Writer `name:"-"`
Stderr io.Writer `name:"-"`
Sources *Sources `name:"-"`
}
func (Config) SetupLogger ¶
func (c Config) SetupLogger()
func (*Config) SetupQuery ¶
func (*Config) SetupSources ¶
Click to show internal directories.
Click to hide internal directories.