common

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionProxy    = "proxy"
	ActionRedirect = "redirect"
	ActionDrop     = "drop"
	ActionNone     = "none"
)

Variables

This section is empty.

Functions

func FormatStringSlice added in v1.1.0

func FormatStringSlice(s []string) string

func FormatStringerSlice added in v1.1.0

func FormatStringerSlice[T fmt.Stringer](s []T) string

Types

type Config

type Config struct {
	Filters []FilterConfig `mapstructure:"filters"`
	Proxies []ProxyConfig  `mapstructure:"proxies"`
}

type FilterConfig

type FilterConfig struct {
	Name   string         `mapstructure:"name"`
	Type   string         `mapstructure:"type"`
	Params map[string]any `mapstructure:"params"`
}

type FilterSettings

type FilterSettings struct {
	Action string `mapstructure:"action"`
	URL    string `mapstructure:"url"`

	NoRejectThreshold uint `mapstructure:"noreject_threshold"`
	RejectThreshold   uint `mapstructure:"reject_threshold"`
}

type ProxyConfig

type ProxyConfig struct {
	Name           string         `mapstructure:"name"`
	Type           string         `mapstructure:"type"`
	ListenAddr     string         `mapstructure:"listen"`
	TargetAddr     string         `mapstructure:"target"`
	Timeout        time.Duration  `mapstructure:"timeout"`
	TLS            *TLS           `mapstructure:"tls"`
	FilterSettings FilterSettings `mapstructure:"filter_settings"`
	Filters        []string       `mapstructure:"filters"`
}

type TLS

type TLS struct {
	Cert string `mapstructure:"cert"`
	Key  string `mapstructure:"key"`
}

Jump to

Keyboard shortcuts

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