Documentation
¶
Index ¶
- func GenerateEmailVerificationCode() string
- func GenerateEmailVerificationKey() string
- type BillingPayment
- type BillingPaymentInformation
- type BillingSubscription
- type Comment
- type CommentString
- type EmailVerification
- type HttpHeaders
- type MentionNotification
- type Notification
- type OAuthConfig
- type OriginalPost
- type Post
- type PostResponse
- type Reaction
- type ReactionCounts
- type StripeBillingState
- type Tag
- type Tenant
- type TenantContact
- type TenantProvider
- type User
- type UserProvider
- type UserWithEmail
- type Vote
- type VoteUser
- type Webhook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateEmailVerificationCode ¶ added in v0.31.0
func GenerateEmailVerificationCode() string
GenerateEmailVerificationCode returns a 6 digit numeric code
func GenerateEmailVerificationKey ¶
func GenerateEmailVerificationKey() string
GenerateEmailVerificationKey returns a 64 chars key
Types ¶
type BillingPayment ¶ added in v0.22.0
type BillingPaymentInformation ¶ added in v0.20.0
type BillingSubscription ¶ added in v0.20.0
type BillingSubscription struct {
UpdateURL string `json:"updateURL"`
CancelURL string `json:"cancelURL"`
PaymentInformation BillingPaymentInformation `json:"paymentInformation"`
LastPayment BillingPayment `json:"lastPayment"`
NextPayment BillingPayment `json:"nextPayment"`
}
type Comment ¶
type Comment struct {
ID int `json:"id"`
Content string `json:"content"`
CreatedAt time.Time `json:"createdAt"`
User *User `json:"user"`
Attachments []string `json:"attachments,omitempty"`
EditedAt *time.Time `json:"editedAt,omitempty"`
EditedBy *User `json:"editedBy,omitempty"`
ReactionCounts []ReactionCounts `json:"reactionCounts,omitempty"`
IsApproved bool `json:"isApproved"`
}
Comment represents an user comment on an post
type CommentString ¶ added in v0.25.0
type CommentString string
func (CommentString) ParseMentions ¶ added in v0.25.0
func (commentString CommentString) ParseMentions() []string
func (CommentString) SanitizeMentions ¶ added in v0.25.0
func (commentString CommentString) SanitizeMentions() string
type EmailVerification ¶
type EmailVerification struct {
Email string
Name string
Key string
Code string
UserID int
Kind enum.EmailVerificationKind
CreatedAt time.Time
ExpiresAt time.Time
VerifiedAt *time.Time
Attempts int
}
EmailVerification is the model used by email verification process
type HttpHeaders ¶ added in v0.20.0
func (*HttpHeaders) Scan ¶ added in v0.20.0
func (h *HttpHeaders) Scan(src any) error
type MentionNotification ¶ added in v0.25.0
type MentionNotification struct {
ID int `json:"id" db:"id"`
TenantID int `json:"-" db:"tenant_id"`
UserID int `json:"userId" db:"user_id"`
CommentID int `json:"commentId,omitempty" db:"comment_id"`
PostID int `json:"postId,omitempty" db:"post_id"`
CreatedAt time.Time `json:"createdAt" db:"created_on"`
}
NotificationLog represents a record of a notification that was sent to a user
type Notification ¶
type Notification struct {
ID int `json:"id" db:"id"`
Title string `json:"title" db:"title"`
Link string `json:"link" db:"link"`
Read bool `json:"read" db:"read"`
CreatedAt time.Time `json:"createdAt" db:"created_at"`
AuthorName string `json:"authorName" db:"name"`
AuthorID int `json:"-" db:"author_id"`
AvatarBlobKey string `json:"-" db:"avatar_bkey"`
AvatarType enum.AvatarType `json:"-" db:"avatar_type"`
AvatarURL string `json:"avatarURL,omitempty"`
}
Notification is the system generated notification entity
type OAuthConfig ¶
type OAuthConfig struct {
ID int
Provider string
DisplayName string
LogoBlobKey string
Status int
ClientID string
ClientSecret string
AuthorizeURL string
TokenURL string
ProfileURL string
Scope string
IsTrusted bool
JSONUserIDPath string
JSONUserNamePath string
JSONUserEmailPath string
JSONUserRolesPath string
AllowedRoles string
}
OAuthConfig is the configuration of a custom OAuth provider
func (OAuthConfig) MarshalJSON ¶
func (o OAuthConfig) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON encoding of OAuthConfig
type OriginalPost ¶
type OriginalPost struct {
Number int `json:"number"`
Title string `json:"title"`
Slug string `json:"slug"`
Status enum.PostStatus `json:"status"`
}
OriginalPost holds details of the original post of a duplicate
func (*OriginalPost) Url ¶ added in v0.20.0
func (i *OriginalPost) Url(baseURL string) string
type Post ¶
type Post struct {
ID int `json:"id"`
Number int `json:"number"`
Title string `json:"title"`
Slug string `json:"slug"`
Description string `json:"description"`
CreatedAt time.Time `json:"createdAt"`
User *User `json:"user"`
HasVoted bool `json:"hasVoted"`
VotesCount int `json:"votesCount"`
CommentsCount int `json:"commentsCount"`
Status enum.PostStatus `json:"status"`
Response *PostResponse `json:"response,omitempty"`
Tags []string `json:"tags"`
IsApproved bool `json:"isApproved"`
}
Post represents an post on a tenant board
func (*Post) CanBeVoted ¶
CanBeVoted returns true if this post can have its vote changed
type PostResponse ¶
type PostResponse struct {
Text string `json:"text"`
RespondedAt time.Time `json:"respondedAt"`
User *User `json:"user"`
Original *OriginalPost `json:"original"`
}
PostResponse is a staff response to a given post
type Reaction ¶ added in v0.23.0
type Reaction struct {
ID int `json:"id"`
Emoji string `json:"emoji"`
Comment *Comment `json:"-"`
User *User `json:"user"`
CreatedAt time.Time `json:"createdAt"`
}
Reaction represents a user's emoji reaction to a comment
type ReactionCounts ¶ added in v0.23.0
type StripeBillingState ¶ added in v0.33.0
type Tag ¶
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"`
WelcomeHeader string `json:"welcomeHeader"`
DescriptionTemplate string `json:"descriptionTemplate"`
CNAME string `json:"cname"`
Status enum.TenantStatus `json:"status"`
Locale string `json:"locale"`
IsPrivate bool `json:"isPrivate"`
LogoBlobKey string `json:"logoBlobKey"`
CustomCSS string `json:"-"`
AllowedSchemes string `json:"allowedSchemes"`
IsEmailAuthAllowed bool `json:"isEmailAuthAllowed"`
IsFeedEnabled bool `json:"isFeedEnabled"`
PreventIndexing bool `json:"preventIndexing"`
IsModerationEnabled bool `json:"isModerationEnabled"`
IsPro bool `json:"isPro"`
// ScheduledDeletionAt is set when the account owner has requested deletion of the whole
// site. The tenant stays active during the grace window; a background job performs the
// hard delete once this time passes. Not exposed to clients.
ScheduledDeletionAt *time.Time `json:"-"`
}
Tenant represents a tenant
func (*Tenant) IsDisabled ¶ added in v0.20.0
type TenantContact ¶ added in v0.20.0
type TenantContact struct {
Name string `json:"name"`
Email string `json:"email"`
Subdomain string `json:"subdomain"`
}
TenantContact is a reference to an administrator account
type TenantProvider ¶ added in v0.30.0
TenantProvider represents tenant-level OAuth provider settings
type User ¶
type User struct {
ID int `json:"id"`
Name string `json:"name"`
Tenant *Tenant `json:"-"`
Email string `json:"-"`
Role enum.Role `json:"role"`
Providers []*UserProvider `json:"-"`
AvatarBlobKey string `json:"-"`
AvatarType enum.AvatarType `json:"-"`
AvatarURL string `json:"avatarURL,omitempty"`
Status enum.UserStatus `json:"status"`
IsTrusted bool `json:"isTrusted"`
SecurityStamp string `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 ¶
IsAdministrator returns true if user is administrator
func (*User) IsCollaborator ¶
IsCollaborator returns true if user has special permissions
func (*User) RequiresModeration ¶ added in v0.33.0
RequiresModeration returns true if user requires moderation
type UserProvider ¶
UserProvider represents the relationship between an User and an Authentication provide
type UserWithEmail ¶ added in v0.22.0
type UserWithEmail struct {
*User
}
UserWithEmail is a wrapper around User that includes the email field when marshaling to JSON
func (UserWithEmail) MarshalJSON ¶ added in v0.22.0
func (umc UserWithEmail) MarshalJSON() ([]byte, error)
type VoteUser ¶
type VoteUser struct {
ID int `json:"id"`
Name string `json:"name"`
Email string `json:"email,omitempty"`
AvatarURL string `json:"avatarURL,omitempty"`
}
VoteUser represents a user that voted on a post
type Webhook ¶ added in v0.20.0
type Webhook struct {
ID int `json:"id" db:"id"`
Name string `json:"name" db:"name"`
Type enum.WebhookType `json:"type" db:"type"`
Status enum.WebhookStatus `json:"status" db:"status"`
Url string `json:"url" db:"url"`
Content string `json:"content" db:"content"`
HttpMethod string `json:"http_method" db:"http_method"`
HttpHeaders HttpHeaders `json:"http_headers" db:"http_headers"`
}
Webhook represents a webhook