domainrouting

package
v7.6.97 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Rules
	None       = Rule("")
	Direct     = Rule("d")
	Proxy      = Rule("p")
	MustProxy  = Rule("m")
	MustDirect = Rule("md")
)

Functions

func AddRules

func AddRules(newRules RulesMap) error

AddRules adds the given rules to the current rules.

func Configure

func Configure(rules RulesMap, proxiedSites *ProxiedSitesConfig)

Configure configures domain routing with the new Rules and ProxiedSitesConfig. The ProxiedSitesConfig is supported for backwards compatibility. All domains in the ProxiedSitesConfig are treated as Proxy rules.

func RemoveRules

func RemoveRules(oldRules RulesMap) error

RemoveRules removes the domains from the current rules.

Types

type ProxiedSitesConfig

type ProxiedSitesConfig struct {
	// Global list of white-listed sites
	Cloud []string
}

ProxiedSitesConfig is a legacy config structure that provides backwards compatibility with old config formats

type Rule

type Rule string

Rule specifies how we should handle traffic to a domain and its sub-domains

func RuleFor

func RuleFor(domain string) Rule

RuleFor returns the Rule most applicable to the given domain. If no such rule is defined, returns None

type Rules

type Rules struct {
	// contains filtered or unexported fields
}

Rules is a tree of domain-routing rules that supports fast evaluation

func NewRules

func NewRules(rules RulesMap) *Rules

Construct a new Rules tree

func (*Rules) RuleFor

func (rules *Rules) RuleFor(domain string) Rule

type RulesMap

type RulesMap map[string]Rule

RulesMap maps domains to their corresponding rules

Jump to

Keyboard shortcuts

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