Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PrintStatusInterval = time.Minute UpstreamTimeout = 30 * time.Second )
Functions ¶
Types ¶
type Dashboard ¶ added in v0.0.5
type Dashboard struct {
LogStatuses map[string]*LogStatus
// contains filtered or unexported fields
}
Dashboard is a log status storage.
func (*Dashboard) Post ¶ added in v0.0.5
func (d *Dashboard) Post(l *LogConnect)
type LogConnect ¶
type LogConnect struct {
Type string `json:"type"`
Time time.Time `json:"time"`
ClientAddr string `json:"client_addr"`
ProxyAddr string `json:"proxy_addr"`
UpstreamAddr string `json:"upstream_addr"`
Status string `json:"status"`
Error error `json:"error"`
ClientAt time.Time `json:"client_at"`
UpstreamAt time.Time `json:"upstream_at"`
ID string `json:"id"`
}
LogConnect represents log at connected
func (*LogConnect) Print ¶
func (l *LogConnect) Print(status string) error
Print prints a log message to STDOUT as JSON.
type LogDisconnect ¶ added in v0.0.5
type LogDisconnect struct {
Type string `json:"type"`
Time time.Time `json:"time"`
ClientAddr string `json:"client_addr"`
ProxyAddr string `json:"proxy_addr"`
UpstreamAddr string `json:"upstream_addr"`
Src string `json:"src"`
Dest string `json:"dest"`
Bytes int64 `json:"bytes"`
Duration float64 `json:"duration"`
Error error `json:"error"`
ID string `json:"id"`
}
LogDisconnect represents log at disconnected
func (*LogDisconnect) Print ¶ added in v0.0.5
func (l *LogDisconnect) Print() error
Print prints a log message to STDOUT as JSON.
type LogStatus ¶ added in v0.0.5
type LogStatus struct {
Type string `json:"type"`
Time time.Time `json:"time"`
ClientAddr string `json:"client_addr"`
ProxyAddr string `json:"proxy_addr"`
UpstreamAddr string `json:"upstream_addr"`
ClientAt time.Time `json:"client_at"`
UpstreamAt time.Time `json:"upstream_at"`
Duration float64 `json:"duration"`
ID string `json:"id"`
}
LogStatus represents a log while in connecting.
type LogSummary ¶ added in v0.0.5
type LogSummary struct {
Type string `json:"type"`
Time time.Time `json:"time"`
Connections int `json:"connections"`
}
LogSummary represents log message for summary of status.
func (*LogSummary) Print ¶ added in v0.0.5
func (l *LogSummary) Print() error
Click to show internal directories.
Click to hide internal directories.