Documentation ¶
Index ¶
- Constants
- func HttpHostHeader(br *bufio.Reader) string
- func Proxy(to BufferedConn, from BufferedConn) <-chan bool
- func Sniff(conn net.Conn, readTimeout time.Duration) (net.Conn, string, error)
- type BufferedConn
- type Cluster
- type ClusterUpdate
- type Conn
- type Context
- type GlobalStats
- type HealthCheck
- type HealthCheckResult
- type HostStats
- type ReadWriteCount
- type Route
- type RouterHost
- type RouterHostWithStats
Constants ¶
View Source
const MAX_HEADER_SIZE = 16385
View Source
const MaxTicks = 40
MaxTicks defines the length of the stats for the UI
Variables ¶
This section is empty.
Functions ¶
func HttpHostHeader ¶
HttpHostHeader returns the HTTP Host header from br without consuming any of its bytes. It returns "" if it can't find one.
func Proxy ¶
func Proxy(to BufferedConn, from BufferedConn) <-chan bool
Types ¶
type BufferedConn ¶
func NewBufferedConn ¶
func NewBufferedConn(c net.Conn) BufferedConn
type Cluster ¶
type Cluster struct { Key string RouterHosts map[string]*RouterHost Routes map[string]Route }
type ClusterUpdate ¶
type ClusterUpdate struct { Routes map[string]Route `json:"routes"` RouterHosts map[string]RouterHost `json:"routerHosts"` }
type Context ¶
type Context struct { HTTPS bool Hostname string Conn BufferedConn }
type GlobalStats ¶
type HealthCheck ¶
type HealthCheck struct {
// contains filtered or unexported fields
}
func NewHealthCheck ¶
func NewHealthCheck(routerHost *RouterHost, checkPort int, status chan HealthCheckResult, checkInterval time.Duration) *HealthCheck
func (*HealthCheck) Start ¶
func (hc *HealthCheck) Start()
func (*HealthCheck) Stop ¶
func (hc *HealthCheck) Stop()
type HealthCheckResult ¶
type HealthCheckResult struct { RouterHost *RouterHost Healthy bool }
type ReadWriteCount ¶
func (ReadWriteCount) IsZero ¶
func (rwc ReadWriteCount) IsZero() bool
type RouterHost ¶
type RouterHost struct { ClusterKey string Name string `json:"name"` HostIP string `json:"hostIP"` HTTPPort int `json:"httpPort"` HTTPSPort int `json:"httpsPort"` LastState HostStats // contains filtered or unexported fields }
func NewRouterHost ¶
func NewRouterHost(name string, ip string, httpPort int, httpsPort int, s chan HealthCheckResult, clusterKey string) *RouterHost
func (*RouterHost) Start ¶
func (rh *RouterHost) Start()
func (*RouterHost) Stop ¶
func (rh *RouterHost) Stop()
Click to show internal directories.
Click to hide internal directories.