logalize

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 15 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 Run

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

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
}

CapGroup represents of one capture group in a config file

type CapGroupList

type CapGroupList []CapGroup

CapGroupList represents of a list of capture groups

type LogFormat

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

LogFormat represents of log format

type Options

type Options struct {
	ConfigPath string // path to configuration file
	NoBuiltins bool   // disable built-in log formats and words
}

Options stores the values of command-line options

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