Documentation
¶
Index ¶
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"`
// 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"`
// 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"`
// Hostname returns the host name reported by the kernel
Hostname string `json:"hostname"`
// 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 interface {
// GetReport get current report data
GetReport() Report
// PutConnection put a new connection
PutConnection(addr string, user *auth.SessionUser)
// DeleteConnection delete a closed connection
DeleteConnection(addr string)
// PutEvent put a file change event
PutEvent(event eventlog.Event)
// PutApiStat put an access log of api
PutApiStat(ip string)
// Enable enable or disable the Reporter
Enable(enabled bool)
}
Reporter collect the report data
func NewReporter ¶ added in v0.6.1
func NewReporter() Reporter
NewReporter create an instance of the Reporter component
Click to show internal directories.
Click to hide internal directories.