Documentation ¶
Overview ¶
Package stats retains a listing of user host names, mapped to nicknames they have ever been seen using, along with some other, rudimentary user statistics.
This is intended to make it easier to pick out trolls, trying to present themselves as new users. While this is by no means fool-proof, it keeps the majority out.
Index ¶
Constants ¶
const ( // ref: https://godoc.org/time#Time.Format TextDateFormat = "2 January, 2006" TextTimeFormat = "15:04 MST" TextNick = "gebruiker" TextUnknownUser = "%s, %s heb ik niet gezien." TextWhoisName = "wieis" TextWhoisDisplay = "%s, ik ken %s sinds %s als: %s" TextWhoisUnknownUser = "%s, ik herken %s niet." TextLastOn = "laston" TextLastOnDisplay = "%s, ik heb %s (%s) het laatst gezien op %s, om %s (± %s geleden)." TextFirstOn = "firston" TextFirstOnDisplay = "%s, ik heb %s (%s) voor het eerst gezien op %s, om %s (± %s geleden)." )
const SaveInterval = time.Minute * 10
SaveInterval determines the time interval after which we save stats data to disk.
Variables ¶
This section is empty.
Functions ¶
func FormatDuration ¶
FormatDuration returns a custom, string representation of the given duration. It is in the correct language and slightly more readable than Go's default time.Duration.String() output.
Types ¶
type User ¶
User defines the hostmask and all known nicknames for a single user. Additionally, it defines some timestamps.
func (*User) AddNickname ¶
AddNickname adds the given nickname to the user's name list, provided it is not already known.
type UserList ¶
type UserList []*User
UserList defines a set of user descriptors, sortable by hostmask.
func (UserList) Find ¶
Find finds the user which exactly matches the given hostmask, or all users which have a fuzzy match with the given nickname. It returns at most limit users.