Limit work
This commit is contained in:
parent
56ab34a57f
commit
42e46a7c22
9 changed files with 114 additions and 62 deletions
17
auth/auth.go
17
auth/auth.go
|
@ -64,7 +64,7 @@ type User struct {
|
|||
Role Role
|
||||
Grants []Grant
|
||||
Prefs *UserPrefs
|
||||
Plan *UserPlan
|
||||
Plan *Plan
|
||||
}
|
||||
|
||||
type UserPrefs struct {
|
||||
|
@ -73,9 +73,18 @@ type UserPrefs struct {
|
|||
Subscriptions []*UserSubscription `json:"subscriptions,omitempty"`
|
||||
}
|
||||
|
||||
type UserPlan struct {
|
||||
Name string `json:"name"`
|
||||
MessagesLimit int `json:"messages_limit"`
|
||||
type PlanCode string
|
||||
|
||||
const (
|
||||
PlanUnlimited = PlanCode("unlimited")
|
||||
PlanDefault = PlanCode("default")
|
||||
PlanNone = PlanCode("none")
|
||||
)
|
||||
|
||||
type Plan struct {
|
||||
Code string `json:"name"`
|
||||
Upgradable bool `json:"upgradable"`
|
||||
RequestLimit int `json:"request_limit"`
|
||||
EmailsLimit int `json:"emails_limit"`
|
||||
AttachmentBytesLimit int64 `json:"attachment_bytes_limit"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue