logalize

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(opts Options, builtins embed.FS) (*koanf.Koanf, error)

func ParseOptions

func ParseOptions(args []string, opts interface{}) (*arg.Parser, error)

ParseOptions parses command-line options

func Run

func Run(reader io.Reader, writer io.StringWriter, config *koanf.Koanf, builtins embed.FS, lemmatizer *golem.Lemmatizer) error

func SetGlobals

func SetGlobals(version, commit, date string)

Types

type CapGroup

type CapGroup struct {
	Pattern      string       `koanf:"pattern"`
	Foreground   string       `koanf:"fg"`
	Background   string       `koanf:"bg"`
	Style        string       `koanf:"style"`
	Alternatives CapGroupList `koanf:"alternatives"`
	Regexp       *regexp.Regexp
}

representation of one capture group in a config file

type CapGroupList

type CapGroupList []CapGroup

representation of a list of capture groups

type LogFormat

type LogFormat struct {
	Name      string
	CapGroups CapGroupList
	Regexp    *regexp.Regexp
}

representation of log format

type Options

type Options struct {
	ConfigPath string `arg:"-c, --config" help:"path to configuration file"`
	NoBuiltins bool   `arg:"-n, --no-builtins" help:"disable built-in log formats and words"`
}

Options stores the values of command-line options

func (Options) Version

func (Options) Version() string

type Pattern

type Pattern struct {
	Name     string
	Priority int
	CapGroup *CapGroup
}

type WordGroup

type WordGroup struct {
	Name       string   `koanf:"name"`
	List       []string `koanf:"list"`
	Foreground string   `koanf:"fg"`
	Background string   `koanf:"bg"`
	Style      string   `koanf:"style"`
}

type Words

type Words struct {
	Good       WordGroup
	Bad        WordGroup
	Other      []WordGroup
	Lemmatizer *golem.Lemmatizer
}

Jump to

Keyboard shortcuts

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