config

package
v0.0.0-...-eb578a8 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: CC0-1.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RuleUnknown   = ""
	RuleAllow     = "ALLOW"
	RuleDeny      = "DENY"
	RuleChallenge = "CHALLENGE"
)

Variables

View Source
var (
	ErrBotMustHaveName                = errors.New("config.Bot: must set name")
	ErrBotMustHaveUserAgentPathOrBoth = errors.New("config.Bot: must set either user_agent_regex, path_regex, query_regex, or networks")
	ErrUnknownAction                  = errors.New("config.Bot: unknown action")
)

Functions

This section is empty.

Types

type Bot

type Bot struct {
	Name           string   `json:"name"`
	UserAgentRegex *string  `json:"user_agent_regex"`
	PathRegex      *string  `json:"path_regex"`
	QueryRegex     *string  `json:"query_regex"`
	Networks       []string `json:"networks"`
	Action         Rule     `json:"action"`
}

func (Bot) Valid

func (b Bot) Valid() error

type Config

type Config struct {
	Bots  []Bot `json:"bots"`
	DNSBL bool  `json:"dnsbl"`
}

type Rule

type Rule string

Jump to

Keyboard shortcuts

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