Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
Target
Priority int `json:"priority"`
Weight int `json:"weight"`
Sni string `json:"sni,omitempty"`
Stats BackendStats `json:"stats"`
}
*
- Backend means upstream server
- with all needed associate information
type BackendStats ¶
type BackendStats struct {
Live bool `json:"live"`
Discovered bool `json:"discovered"`
TotalConnections int64 `json:"total_connections"`
ActiveConnections uint `json:"active_connections"`
RefusedConnections uint64 `json:"refused_connections"`
RxBytes uint64 `json:"rx"`
TxBytes uint64 `json:"tx"`
RxSecond uint `json:"rx_second"`
TxSecond uint `json:"tx_second"`
}
*
- Backend status
type Balancer ¶
type Balancer interface {
/**
* Elect backend based on Balancer implementation
*/
Elect(Context, []*Backend) (*Backend, error)
}
*
- Balancer interface
type ReadWriteCount ¶
type ReadWriteCount struct {
/* Read bytes count */
CountRead uint
/* Write bytes count */
CountWrite uint
Target Target
}
*
- Next r/w operation data counters
func (ReadWriteCount) IsZero ¶
func (this ReadWriteCount) IsZero() bool
type Server ¶
type Server interface {
/**
* Start server
*/
Start() error
/**
* Stop server and wait until it stop
*/
Stop()
/**
* Get server configuration
*/
Cfg() config.Server
}
*
- Server interface
type Service ¶
type Service interface {
/**
* Enable service for Server
*/
Enable(Server) error
/**
* Disable service for Server
*/
Disable(Server) error
}
*
- Service is a global facility that could be Enabled or Disabled for a number
- of core.Server instances, depending on their configration. See services/registry
- for exact examples.
type TcpContext ¶
*
- Proxy tcp context
func (TcpContext) Ip ¶
func (t TcpContext) Ip() net.IP
func (TcpContext) Port ¶
func (t TcpContext) Port() int
func (TcpContext) Sni ¶
func (t TcpContext) Sni() string
func (TcpContext) String ¶
func (t TcpContext) String() string
type UdpContext ¶
* Proxy udp context
func (UdpContext) Ip ¶
func (u UdpContext) Ip() net.IP
func (UdpContext) Port ¶
func (u UdpContext) Port() int
func (UdpContext) Sni ¶
func (u UdpContext) Sni() string
func (UdpContext) String ¶
func (u UdpContext) String() string
Click to show internal directories.
Click to hide internal directories.