Write stats to user table asynchronously
This commit is contained in:
parent
2f567af80b
commit
cc55bec521
6 changed files with 102 additions and 51 deletions
|
@ -17,6 +17,7 @@ type Manager interface {
|
|||
CreateToken(user *User) (string, error)
|
||||
RemoveToken(user *User) error
|
||||
ChangeSettings(user *User) error
|
||||
EnqueueUpdateStats(user *User)
|
||||
|
||||
// Authorize returns nil if the given user has access to the given topic using the desired
|
||||
// permission. The user param may be nil to signal an anonymous user.
|
||||
|
@ -65,6 +66,7 @@ type User struct {
|
|||
Grants []Grant
|
||||
Prefs *UserPrefs
|
||||
Plan *Plan
|
||||
Stats *Stats
|
||||
}
|
||||
|
||||
type UserPrefs struct {
|
||||
|
@ -102,6 +104,11 @@ type UserNotificationPrefs struct {
|
|||
DeleteAfter int `json:"delete_after,omitempty"`
|
||||
}
|
||||
|
||||
type Stats struct {
|
||||
Messages int64
|
||||
Emails int64
|
||||
}
|
||||
|
||||
// Grant is a struct that represents an access control entry to a topic
|
||||
type Grant struct {
|
||||
TopicPattern string // May include wildcard (*)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue