bfe_route

package
v1.8.9 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoProduct     = errors.New("no product found")
	ErrNoProductRule = errors.New("no route rule found for product")
	ErrNoMatchRule   = errors.New("no rule match for this req")
)

Functions

This section is empty.

Types

type ClusterMap

type ClusterMap map[string]*bfe_cluster.BfeCluster

ClusterMap holds mappings from clusterName to cluster.

type ClusterTable

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

func (*ClusterTable) BasicInit

func (t *ClusterTable) BasicInit(clusterConfs cluster_conf.BfeClusterConf)

func (*ClusterTable) ClusterMap

func (t *ClusterTable) ClusterMap() ClusterMap

func (*ClusterTable) GetVersions

func (t *ClusterTable) GetVersions() ClusterVersion

func (*ClusterTable) Init

func (t *ClusterTable) Init(clusterConfFilename string, kr *crypto.Keyring) error

func (*ClusterTable) Lookup

func (t *ClusterTable) Lookup(clusterName string) (*bfe_cluster.BfeCluster, error)

type ClusterVersion

type ClusterVersion struct {
	ClusterConfVer string // version of cluster-conf
}

type HostTable

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

HostTable holds mappings from host to prduct and mappings from product to cluster rules.

func (*HostTable) GetStatus

func (t *HostTable) GetStatus() Status

GetStatus return status of host table.

func (*HostTable) GetVersions

func (t *HostTable) GetVersions() Versions

GetVersions return versions of host table.

func (*HostTable) Lookup

Lookup find cluster name with given hostname.

func (*HostTable) LookupCluster

func (t *HostTable) LookupCluster(req *bfe_basic.Request) error

LookupCluster find clusterName with given request.

func (*HostTable) LookupHostTagAndProduct

func (t *HostTable) LookupHostTagAndProduct(req *bfe_basic.Request) error

LookupHostTagAndProduct find hosttag and product with given hostname.

func (*HostTable) LookupProduct

func (t *HostTable) LookupProduct(hostname string) (string, error)

LookupProduct find product name with given hostname.

func (*HostTable) LookupProductByVip

func (t *HostTable) LookupProductByVip(vip string) (string, error)

LookupProductByVip find product name by vip.

func (*HostTable) Update

func (t *HostTable) Update(hostConf host_rule_conf.HostConf,
	vipConf vip_rule_conf.VipConf, routeConf *route_rule_conf.RouteTableConf)

Update updates host table

type ServerDataConf

type ServerDataConf struct {
	HostTable    *HostTable
	ClusterTable *ClusterTable
}

func LoadServerDataConf

func LoadServerDataConf(hostFile, vipFile, routeFile, clusterConfFile string,
	kr *crypto.Keyring) (*ServerDataConf, error)

LoadServerDataConf loads ServerDataConf config. kr is the file-encryption keyring used to decrypt enc$v1$ AIConf.Keys[].Key entries; nil means decryption disabled (marker-prefixed values then fail the load).

func (*ServerDataConf) ClusterTableLookup

func (s *ServerDataConf) ClusterTableLookup(clusterName string) (*bfe_cluster.BfeCluster, error)

ClusterTableLookup find backend with given cluster-name and request. implement interface ServerDataConfInterface.

func (*ServerDataConf) HostTableLookup

func (s *ServerDataConf) HostTableLookup(hostname string) (string, error)

HostTableLookup find cluster name with given hostname. implement interface ServerDataConfInterface.

type Status

type Status struct {
	HostTableSize              int
	HostTagTableSize           int
	VipTableSize               int
	ProductRouteTableSize      int
	ProductBasicRouteTableSize int
}

type Versions

type Versions struct {
	HostTag      string // version of host-tag
	Vip          string // version of vip rule
	ProductRoute string // version of product route rule
}

Directories

Path Synopsis
Package trie implements a simple trie data structure that maps "paths" (which are slices of strings) to arbitrary data values (type interface{}).
Package trie implements a simple trie data structure that maps "paths" (which are slices of strings) to arbitrary data values (type interface{}).

Jump to

Keyboard shortcuts

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