Documentation ¶
Index ¶
Constants ¶
View Source
const ( // FREE plan, 100 users FREE = Plan("FREE") // ENTERPRISE plan, 1000 users ENTERPRISE = Plan("ENTERPRISE") )
Variables ¶
View Source
var APIkeyTableSQL = `CREATE TABLE IF NOT EXISTS apikey (
key_hash CHARACTER(64) PRIMARY KEY,
account_id CHARACTER(36));`
APIkeyTableSQL is the SQL statement for creating a table corresponding to the APIkey model
View Source
var AccountTableSQL = `` /* 242-byte string literal not displayed */
AccountTableSQL is the SQL statement for creating a table corresponding to the Account model
View Source
var MetricTableSQL = `` /* 147-byte string literal not displayed */
MetricTableSQL is the SQL statement for createing a table corresponding to the Metric model
View Source
var PlanMaxUsers = map[Plan]int{ FREE: 100, ENTERPRISE: 1000, }
PlanMaxUsers specifies the maximum number of users for each plan
View Source
var UserTableSQL = `` /* 162-byte string literal not displayed */
UserTableSQL is the SQL statement for createing a table corresponding to the User model
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { AccountID string `db:"account_id"` Plan Plan `db:"plan"` // One of "FREE" or "ENTERPRISE" Email string `db:"email"` PasswordHash string `db:"password_hash"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` }
Account represents a row in the "account" table.
Click to show internal directories.
Click to hide internal directories.