route_rule_conf

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	AdvancedMode = "ADVANCED_MODE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvancedRouteRule added in v1.3.0

type AdvancedRouteRule struct {
	Cond        condition.Condition
	ClusterName string
}

AdvancedRouteRule is composed by a condition and cluster to serve

type AdvancedRouteRuleFile added in v1.3.0

type AdvancedRouteRuleFile struct {
	Cond        *string
	ClusterName *string
}

type AdvancedRouteRuleFiles added in v1.3.0

type AdvancedRouteRuleFiles []AdvancedRouteRuleFile

type AdvancedRouteRules added in v1.3.0

type AdvancedRouteRules []AdvancedRouteRule

type BasicRouteRule added in v1.3.0

type BasicRouteRule struct {
	Hostname    []string
	Path        []string
	ClusterName string
}

BasicRouteRule is for host+path routing [host, path] -> cluster

type BasicRouteRuleFile added in v1.3.0

type BasicRouteRuleFile struct {
	Hostname    []string
	Path        []string
	ClusterName *string
}

type BasicRouteRuleFiles added in v1.3.0

type BasicRouteRuleFiles []BasicRouteRuleFile

type BasicRouteRuleTree added in v1.3.0

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

BasicRouteRuleTree implements radix trees for host+path matching hostTree (key:hostname, value:pathTree) pathTree (key:path, value:clusterName)

func NewBasicRouteRuleTree added in v1.3.0

func NewBasicRouteRuleTree() *BasicRouteRuleTree

func (*BasicRouteRuleTree) Get added in v1.3.0

func (r *BasicRouteRuleTree) Get(host, path string) (string, bool)

Get returns cluster name by host and path

func (*BasicRouteRuleTree) Insert added in v1.3.0

func (r *BasicRouteRuleTree) Insert(ruleConf *BasicRouteRuleFile) error

Insert adds a new basic route rule into BasicRouteRuleTree key: hostname, value: pathTrees

type BasicRouteRules added in v1.3.0

type BasicRouteRules []BasicRouteRule

type ProductAdvancedRouteRule added in v1.3.0

type ProductAdvancedRouteRule map[string]AdvancedRouteRules

type ProductAdvancedRouteRuleFile added in v1.3.0

type ProductAdvancedRouteRuleFile map[string]AdvancedRouteRuleFiles

type ProductBasicRouteRule added in v1.3.0

type ProductBasicRouteRule map[string]BasicRouteRules

type ProductBasicRouteRuleFile added in v1.3.0

type ProductBasicRouteRuleFile map[string]BasicRouteRuleFiles

type ProductBasicRouteTree added in v1.3.0

type ProductBasicRouteTree map[string]*BasicRouteRuleTree

type RouteTableConf

type RouteTableConf struct {
	Version         string // version of the config
	BasicRuleMap    ProductBasicRouteRule
	BasicRuleTree   ProductBasicRouteTree
	AdvancedRuleMap ProductAdvancedRouteRule
}

func Convert added in v1.3.0

func Convert(fileConf *RouteTableFile) (*RouteTableConf, error)

func RouteConfLoad

func RouteConfLoad(filename string) (*RouteTableConf, error)

RouteConfLoad loads config of route table from file.

func (*RouteTableConf) LoadAndCheck

func (conf *RouteTableConf) LoadAndCheck(filename string) (string, error)

type RouteTableFile

type RouteTableFile struct {
	Version *string // version of the config

	// product => rules (basic rule)
	BasicRule *ProductBasicRouteRuleFile

	// product => rules (advanced rule)
	ProductRule *ProductAdvancedRouteRuleFile
}

Jump to

Keyboard shortcuts

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