Documentation ¶
Index ¶
- Variables
- func AddFlowIn(proxyName string, value int64)
- func AddFlowOut(proxyName string, value int64)
- func CloseConnection(proxyName string)
- func OpenConnection(proxyName string)
- func SetProxyInfo(proxyName string, proxyType, bindAddr string, ...)
- func SetStatus(proxyName string, status int64)
- type DailyServerStats
- type DealFuncType
- type ServerMetric
- type ServerMetricList
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DailyDataKeepDays int = 7 ServerMetricInfoMap map[string]*ServerMetric )
Functions ¶
func AddFlowOut ¶
func CloseConnection ¶
func CloseConnection(proxyName string)
func OpenConnection ¶
func OpenConnection(proxyName string)
func SetProxyInfo ¶
Types ¶
type DailyServerStats ¶
type DailyServerStats struct { Time string `json:"time"` FlowIn int64 `json:"flow_in"` FlowOut int64 `json:"flow_out"` TotalAcceptConns int64 `json:"total_accept_conns"` }
func DealDailyData ¶
func DealDailyData(dailyData []*DailyServerStats, fn DealFuncType) (newDailyData []*DailyServerStats)
type DealFuncType ¶
type DealFuncType func(*DailyServerStats)
type ServerMetric ¶
type ServerMetric struct { Name string `json:"name"` Type string `json:"type"` BindAddr string `json:"bind_addr"` ListenPort int64 `json:"listen_port"` CustomDomains []string `json:"custom_domains"` Status string `json:"status"` UseEncryption bool `json:"use_encryption"` UseGzip bool `json:"use_gzip"` PrivilegeMode bool `json:"privilege_mode"` // statistics CurrentConns int64 `json:"current_conns"` Daily []*DailyServerStats `json:"daily"` // contains filtered or unexported fields }
func GetAllProxyMetrics ¶
func GetAllProxyMetrics() []*ServerMetric
func GetProxyMetrics ¶
func GetProxyMetrics(proxyName string) *ServerMetric
if proxyName isn't exist, return nil
type ServerMetricList ¶
type ServerMetricList []*ServerMetric
for sort
func (ServerMetricList) Len ¶
func (l ServerMetricList) Len() int
func (ServerMetricList) Less ¶
func (l ServerMetricList) Less(i, j int) bool
func (ServerMetricList) Swap ¶
func (l ServerMetricList) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.