Restructure limits

This commit is contained in:
binwiederhier 2022-12-19 16:22:13 -05:00
parent 6598ce2fe4
commit 84785b7a60
7 changed files with 105 additions and 74 deletions

View file

@ -84,7 +84,7 @@ const (
type Plan struct {
Code string `json:"name"`
Upgradable bool `json:"upgradable"`
MessageLimit int64 `json:"messages_limit"`
MessagesLimit int64 `json:"messages_limit"`
EmailsLimit int64 `json:"emails_limit"`
AttachmentFileSizeLimit int64 `json:"attachment_file_size_limit"`
AttachmentTotalSizeLimit int64 `json:"attachment_total_size_limit"`

View file

@ -110,7 +110,7 @@ const (
selectSchemaVersionQuery = `SELECT version FROM schemaVersion WHERE id = 1`
)
// SQLiteAuthManager is an implementation of Manager and Manager. It stores users and access control list
// SQLiteAuthManager is an implementation of Manager. It stores users and access control list
// in a SQLite database.
type SQLiteAuthManager struct {
db *sql.DB
@ -355,7 +355,7 @@ func (a *SQLiteAuthManager) readUser(rows *sql.Rows) (*User, error) {
user.Plan = &Plan{
Code: planCode.String,
Upgradable: true, // FIXME
MessageLimit: messagesLimit.Int64,
MessagesLimit: messagesLimit.Int64,
EmailsLimit: emailsLimit.Int64,
AttachmentFileSizeLimit: attachmentFileSizeLimit.Int64,
AttachmentTotalSizeLimit: attachmentTotalSizeLimit.Int64,