bfe_route

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

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) 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) (*ServerDataConf, error)

LoadServerDataConf loads ServerDataConf config.

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
}

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