Documentation
¶
Overview ¶
Package proxy ... this file mainly to load from file and set proxy rules
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBalancerNotMatched plugin.Proxy balancer not matched ErrBalancerNotMatched = errors.New("plugin.Proxy balancer not matched") // ErrPageNotFound can not found page ErrPageNotFound = errors.New("404 Page Not Found") // ErrNoReverseServer ... ErrNoReverseServer = errors.New("could not found reverse proxy") )
View Source
var ( // ErrTimeout ... ErrTimeout = errors.New("combineReq timeout error") )
Functions ¶
Types ¶
type Balancer ¶
type Balancer struct {
// contains filtered or unexported fields
}
Balancer ...
func NewBalancer ¶
func NewBalancer(servers []ServerCfgInterface) *Balancer
NewBalancer ... 初始化调度器 Notice: https://github.com/golang/go/wiki/InterfaceSlice
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy ...
func New ¶
func New( reverseServers map[string][]rule.ReverseServer, pathRules []rule.PathRuler, srvRules []rule.ServerRuler, ) *Proxy
New ... load configs from outter to generate a new proxy plugin
type ServerCfgInterface ¶
type ServerCfgInterface interface {
// W means weight
W() int
}
ServerCfgInterface ...
Click to show internal directories.
Click to hide internal directories.