config

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal added in v0.1.17

func Marshal(opts ...OptT) string

func WithWindow added in v0.1.17

func WithWindow(window time.Duration) func(*optsT)

func WriteDefaultConfig

func WriteDefaultConfig(path string, opts ...OptT) error

Types

type Config

type Config struct {
	TimestampRegexes []Regex             `yaml:"timestamps"`
	Rules            Rules               `yaml:"rules"`
	UpdateFrequency  *time.Duration      `yaml:"updateFrequency"`
	RulesVersion     string              `yaml:"rulesVersion"`
	AcceptUpdates    bool                `yaml:"acceptUpdates"`
	DataSources      string              `yaml:"dataSources"`
	Notification     NotificationWebhook `yaml:"notification"`
	Window           time.Duration       `yaml:"window"`
	Skip             int                 `yaml:"skip"`
}

func LoadConfig

func LoadConfig(dir, file string, opts ...OptT) (*Config, error)

func LoadConfigFromBytes

func LoadConfigFromBytes(data string) (*Config, error)

func (*Config) ResolveOpts

func (c *Config) ResolveOpts() (opts []resolve.OptT)

type NotificationWebhook added in v0.1.7

type NotificationWebhook struct {
	Type    string `yaml:"type"`
	Webhook string `yaml:"webhook"`
}

type OptT added in v0.1.17

type OptT func(*optsT)

type Regex

type Regex struct {
	Pattern string `yaml:"pattern"`
	Format  string `yaml:"format"`
}

type Rules

type Rules struct {
	Paths    []string `yaml:"paths"`
	Disabled bool     `yaml:"disableCommunityRules"`
}

Jump to

Keyboard shortcuts

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