Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Filename string // database file name LimitDays uint32 // time limit (in days) UnitID unitIDCallback // user function to get the current unit ID. If nil, the current time hour is used. AnonymizeClientIP bool // anonymize clients' IP addresses // Called when the configuration is changed by HTTP request ConfigModified func() // Register an HTTP handler HTTPRegister func(string, string, func(http.ResponseWriter, *http.Request)) // contains filtered or unexported fields }
Config - module configuration
type DiskConfig ¶
type DiskConfig struct {
Interval uint32 `yaml:"statistics_interval"` // time interval for statistics (in days)
}
DiskConfig - configuration settings that are stored on disk
type Entry ¶
type Entry struct { Domain string Client net.IP Result Result Time uint32 // processing time (msec) }
Entry - data to add
type Stats ¶
type Stats interface { Start() // Close object. // This function is not thread safe // (can't be called in parallel with any other function of this interface). Close() // Update counters Update(e Entry) // Get IP addresses of the clients with the most number of requests GetTopClientsIP(limit uint) []string // WriteDiskConfig - write configuration WriteDiskConfig(dc *DiskConfig) }
Stats - main interface
Click to show internal directories.
Click to hide internal directories.