Documentation
¶
Index ¶
- Variables
- type AppSettings
- type AssignUnassignTag
- type ChangeUserRole
- type Comment
- type CompleteProfile
- type CreateEditTag
- type CreateTenant
- type DeleteTag
- type FiderClaims
- type Idea
- type IdeaResponse
- type NewComment
- type NewIdea
- type OAuthClaims
- type Role
- type SetResponse
- type SignInByEmail
- type SignInRequest
- type Tag
- type Tenant
- type UpdateIdea
- type UpdateTenantSettings
- type UpdateUserSettings
- type User
- type UserProvider
Constants ¶
This section is empty.
Variables ¶
var ( //IdeaNew is the default status IdeaNew = 0 //IdeaStarted is used when the idea has been accepted and work is in progress IdeaStarted = 1 //IdeaCompleted is used when the idea has been accepted and already implemented IdeaCompleted = 2 //IdeaDeclined is used when organizers decide to decline an idea IdeaDeclined = 3 )
var ( //TenantActive is the default status for most tenants TenantActive = 1 //TenantInactive is used for signup via e-mail that requires user confirmation TenantInactive = 2 )
Functions ¶
This section is empty.
Types ¶
type AppSettings ¶
type AppSettings struct {
Mode string `json:"mode"`
BuildTime string `json:"buildTime"`
Version string `json:"version"`
Environment string `json:"environment"`
GoogleAnalytics string `json:"googleAnalytics"`
Compiler string `json:"compiler"`
Domain string `json:"domain"`
}
AppSettings is an application-wide settings
type AssignUnassignTag ¶ added in v0.8.0
AssignUnassignTag is used to assign or remove a tag to/from an idea
type ChangeUserRole ¶ added in v0.7.0
ChangeUserRole is the input model change role of an user
type Comment ¶
type Comment struct {
ID int `json:"id"`
Content string `json:"content"`
CreatedOn time.Time `json:"createdOn"`
User *User `json:"user"`
}
Comment represents an user comment on an idea
type CompleteProfile ¶ added in v0.6.0
CompleteProfile is the model used to complete user profile during e-mail sign in
type CreateEditTag ¶ added in v0.8.0
type CreateEditTag struct {
Slug string `route:"slug"`
Name string `json:"name"`
Color string `json:"color" format:"upper"`
IsPublic bool `json:"isPublic"`
}
CreateEditTag is used to create a new tag or edit existing
type CreateTenant ¶ added in v0.5.0
type CreateTenant struct {
Token string `json:"token"`
Name string `json:"name"`
Email string `json:"email" format:"lower"`
VerificationKey string
TenantName string `json:"tenantName"`
Subdomain string `json:"subdomain" format:"lower"`
UserClaims *OAuthClaims
}
CreateTenant is the input model used to create a tenant
type DeleteTag ¶ added in v0.8.0
type DeleteTag struct {
Slug string `route:"slug"`
}
DeleteTag is used to delete an existing tag
type FiderClaims ¶
type FiderClaims struct {
UserID int `json:"user/id"`
UserName string `json:"user/name"`
UserEmail string `json:"user/email"`
jwt.StandardClaims
}
FiderClaims represents what goes into JWT tokens
type Idea ¶
type Idea struct {
ID int `json:"id"`
Number int `json:"number"`
Title string `json:"title"`
Slug string `json:"slug"`
Description string `json:"description"`
CreatedOn time.Time `json:"createdOn"`
User *User `json:"user"`
TotalSupporters int `json:"totalSupporters"`
TotalComments int `json:"totalComments"`
Status int `json:"status"`
Response *IdeaResponse `json:"response"`
Tags []int64 `json:"tags"`
}
Idea represents an idea on a tenant board
type IdeaResponse ¶
type IdeaResponse struct {
Text string `json:"text"`
RespondedOn time.Time `json:"respondedOn"`
User *User `json:"user"`
}
IdeaResponse is a staff response to a given idea
type NewComment ¶ added in v0.5.0
NewComment represents a new comment
type OAuthClaims ¶
type OAuthClaims struct {
OAuthID string `json:"oauth/id"`
OAuthProvider string `json:"oauth/provider"`
OAuthName string `json:"oauth/name"`
OAuthEmail string `json:"oauth/email"`
jwt.StandardClaims
}
OAuthClaims represents what goes into temporary OAuth JWT tokens
type SetResponse ¶ added in v0.5.0
type SetResponse struct {
Number int `route:"number"`
Status int `json:"status"`
Text string `json:"text"`
}
SetResponse represents the action to update an idea response
type SignInByEmail ¶ added in v0.6.0
SignInByEmail is the input model when user request to sign in by email
type SignInRequest ¶ added in v0.6.0
type SignInRequest struct {
Email string
Name string
Key string
CreatedOn time.Time
ExpiresOn time.Time
VerifiedOn *time.Time
}
SignInRequest is the model used by e-mail verification process
type Tag ¶ added in v0.8.0
type Tag struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Color string `json:"color"`
IsPublic bool `json:"isPublic"`
}
Tag represents a simple tag
type Tenant ¶
type Tenant struct {
ID int `json:"id"`
Name string `json:"name"`
Subdomain string `json:"subdomain"`
Invitation string `json:"invitation"`
WelcomeMessage string `json:"welcomeMessage"`
CNAME string `json:"cname"`
Status int `json:"-"`
}
Tenant represents a tenant
type UpdateIdea ¶ added in v0.8.0
type UpdateIdea struct {
Number int `route:"number"`
Title string `json:"title"`
Description string `json:"description"`
}
UpdateIdea represents a request to edit an existing idea
type UpdateTenantSettings ¶ added in v0.5.0
type UpdateTenantSettings struct {
Title string `json:"title"`
Invitation string `json:"invitation"`
WelcomeMessage string `json:"welcomeMessage"`
CNAME string `json:"cname" format:"lower"`
UserClaims *OAuthClaims
}
UpdateTenantSettings is the input model used to update tenant settings
type UpdateUserSettings ¶ added in v0.6.0
type UpdateUserSettings struct {
Name string `json:"name"`
}
UpdateUserSettings is the model used to update user's settings
type User ¶
type User struct {
ID int `json:"id"`
Name string `json:"name"`
Email string `json:"-"`
Gravatar string `json:"gravatar"`
Tenant *Tenant `json:"-"`
Role Role `json:"role"`
Providers []*UserProvider `json:"-"`
}
User represents an user inside our application
func (*User) HasProvider ¶
HasProvider returns true if current user has registered with given provider
func (*User) IsAdministrator ¶ added in v0.7.0
IsAdministrator returns true if user is administrator
func (*User) IsCollaborator ¶ added in v0.7.0
IsCollaborator returns true if user has special permissions
type UserProvider ¶
UserProvider represents the relashionship between an User and an Authentication provide