Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RolePublic for publicly accessible routes. RolePublic Roles = 0 // RoleFree for free user. RoleFree = 10 // RoleUser for standard user. RoleUser = 20 // RoleAdmin for admins. RoleAdmin = 99 )
Variables ¶
This section is empty.
Functions ¶
func NewFriendlyID ¶
NewFriendlyID returns a ~somewhat unique friendly id.
func ParseToken ¶
ParseToken returns the id and uuid for a given token.
func StringToKey ¶
Types ¶
type APIRequest ¶
type APIRequest struct { ID int64 ` json:"id"` AccountID int64 ` json:"accountId"` UserID int64 ` json:"userId"` URL string `json:"url"` Requested time.Time ` json:"requested"` StatusCode int ` json:"statusCode"` RequestID string ` json:"reqId"` }
APIRequest represents a single API call.
type AccessToken ¶
type AccessToken struct { ID int64 ` json:"id"` UserID int64 ` json:"userId"` Name string ` json:"name"` Token string ` json:"token"` }
AccessToken represents access tokens.
type Account ¶
type Account struct { ID int64 `json:"id"` Email string `json:"email"` StripeID string `json:"stripeId"` SubscriptionID string `json:"subscriptionId"` Plan string ` json:"plan"` IsYearly bool `json:"isYearly"` SubscribedOn time.Time `json:"subscribed"` Seats int ` json:"seats"` TrialInfo Trial ` json:"trial"` IsActive bool ` json:"active"` Users []User ` json:"users"` }
Account represents the basic information for an account.
type Roles ¶
type Roles int
Roles are used with user access control and authorization. You may add custom roles in-between the default ones.
type Trial ¶
type Trial struct { IsTrial bool ` json:"trial"` Plan string ` json:"plan"` Start time.Time ` json:"start"` Extended int ` json:"extended"` }
Trial represents the trial information for an account.
Click to show internal directories.
Click to hide internal directories.