Documentation
¶
Index ¶
- type ApiStat
- type ConnStat
- type EventStat
- type Report
- type Reporter
- func (r *Reporter) DeleteConnection(addr string)
- func (r *Reporter) Enable(enabled bool)
- func (r *Reporter) GetReport() Report
- func (r *Reporter) PutApiStat(ip string)
- func (r *Reporter) PutAuth(addr string, user *auth.HashUser)
- func (r *Reporter) PutConnection(addr string)
- func (r *Reporter) PutEvent(event eventlog.Event)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiStat ¶
type ApiStat struct {
// AccessCount all the api access count
AccessCount uint64 `json:"access_count"`
// VisitorStat the statistical data of visitors
VisitorStat map[string]uint64 `json:"visitor_stat"`
}
ApiStat the statistical data of api access info
type ConnStat ¶
type ConnStat struct {
// Addr the client connection address
Addr string `json:"addr"`
// IsAuth whether the client is authorized
IsAuth bool `json:"is_auth"`
// UserName the username of client
UserName string `json:"username"`
// Perm the permission of client
Perm string `json:"perm"`
// ConnectTime the connected time of client
ConnectTime timeutil.Time `json:"connect_time"`
// AuthTime the authorized time of client
AuthTime timeutil.Time `json:"auth_time"`
// DisconnectTime the disconnected time of client
DisconnectTime timeutil.Time `json:"disconnect_time"`
// LifeTime the lifetime of a client, it is 0s always that if the client is online
LifeTime core.Duration `json:"life_time"`
}
ConnStat the client connection info
type Report ¶
type Report struct {
// CurrentTime returns the current server time
CurrentTime timeutil.Time `json:"current_time"`
// StartTime returns the server start time
StartTime timeutil.Time `json:"start_time"`
// UpTime returns the server up time
UpTime core.Duration `json:"up_time"`
// Pid returns the process id of the caller
Pid int `json:"pid"`
// PPid returns the process id of the caller's parent
PPid int `json:"ppid"`
// GOOS is the running program's operating system target
GOOS string `json:"go_os"`
// GOARCH is the running program's architecture target
GOARCH string `json:"go_arch"`
// GOVersion returns the Go tree's version string
GOVersion string `json:"go_version"`
// Version returns the version info of the gofs
Version string `json:"version"`
// Commit returns last commit hash value of the gofs
Commit string `json:"commit"`
// Online returns the client connection info that is online
Online map[string]*ConnStat `json:"online"`
// Offline returns the client connection info that is offline
Offline []*ConnStat `json:"offline"`
// Events returns some latest file change events
Events *toplist.TopList `json:"events"`
// EventStat returns the statistical data of file change events
EventStat EventStat `json:"event_stat"`
// ApiStat returns the statistical data of api access info
ApiStat ApiStat `json:"api_stat"`
}
Report the program report data
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter collect the report data
var ( // GlobalReporter the global reporter GlobalReporter *Reporter )
func (*Reporter) DeleteConnection ¶
DeleteConnection delete a closed connection
func (*Reporter) PutApiStat ¶
PutApiStat put an access log of api
func (*Reporter) PutConnection ¶
PutConnection put a new connection
Click to show internal directories.
Click to hide internal directories.