Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( //NotificationEventNewPost is triggered when a new post is posted NotificationEventNewPost = NotificationEvent{ UserSettingsKeyName: "event_notification_new_post", DefaultSettingValue: strconv.Itoa(int(NotificationChannelWeb | NotificationChannelEmail)), RequiresSubscriptionUserRoles: []Role{}, DefaultEnabledUserRoles: []Role{ RoleAdministrator, RoleCollaborator, }, Validate: notificationEventValidation, } //NotificationEventNewComment is triggered when a new comment is posted NotificationEventNewComment = NotificationEvent{ UserSettingsKeyName: "event_notification_new_comment", DefaultSettingValue: strconv.Itoa(int(NotificationChannelWeb | NotificationChannelEmail)), RequiresSubscriptionUserRoles: []Role{ RoleVisitor, }, DefaultEnabledUserRoles: []Role{ RoleAdministrator, RoleCollaborator, }, Validate: notificationEventValidation, } //NotificationEventChangeStatus is triggered when a new post has its status changed NotificationEventChangeStatus = NotificationEvent{ UserSettingsKeyName: "event_notification_change_status", DefaultSettingValue: strconv.Itoa(int(NotificationChannelWeb | NotificationChannelEmail)), RequiresSubscriptionUserRoles: []Role{ RoleVisitor, }, DefaultEnabledUserRoles: []Role{ RoleAdministrator, RoleCollaborator, RoleVisitor, }, Validate: notificationEventValidation, } //AllNotificationEvents contains all possible notification events AllNotificationEvents = []NotificationEvent{ NotificationEventNewPost, NotificationEventNewComment, NotificationEventChangeStatus, } )
var ( //OAuthConfigDisabled is used to disable an OAuthConfig for signin OAuthConfigDisabled = 1 //OAuthConfigEnabled is used to enable an OAuthConfig for public use OAuthConfigEnabled = 2 )
var ( //SubscriberInactive means that the user cancelled the subscription SubscriberInactive = 0 //SubscriberActive means that the subscription is active SubscriberActive = 1 )
Functions ¶
This section is empty.
Types ¶
type AvatarType ¶
type AvatarType int
AvatarType are the possible types of a user avatar
var ( //AvatarTypeLetter is the default avatar type for users AvatarTypeLetter AvatarType = 1 //AvatarTypeGravatar fetches avatar from gravatar (if available) AvatarTypeGravatar AvatarType = 2 //AvatarTypeCustom uses a user uploaded avatar AvatarTypeCustom AvatarType = 3 //AvatarTypeOAuth uses the avatar from the OAuth provider AvatarTypeOAuth AvatarType = 4 )
func (AvatarType) MarshalText ¶
func (t AvatarType) MarshalText() ([]byte, error)
MarshalText returns the Text version of the avatar type
func (AvatarType) String ¶
func (t AvatarType) String() string
String returns the string version of the avatar type
func (*AvatarType) UnmarshalText ¶
func (t *AvatarType) UnmarshalText(text []byte) error
UnmarshalText parse string into a avatar type
type BillingStatus ¶
type BillingStatus int
var ( //BillingTrial is used for tenants in trial BillingTrial BillingStatus = 1 //BillingActive is used for tenants with an active subscription BillingActive BillingStatus = 2 //BillingCancelled is used for tenants that had an active subscription, but have cancelled it BillingCancelled BillingStatus = 3 //BillingFreeForever is used for tenants that are on a forever free plan BillingFreeForever BillingStatus = 4 //BillingOpenCollective is used for tenants that have an active open collective subsription BillingOpenCollective BillingStatus = 5 )
func (BillingStatus) String ¶
func (status BillingStatus) String() string
String returns the string version of the billing status
type EmailVerificationKind ¶
type EmailVerificationKind int16
EmailVerificationKind specifies which kind of process is being verified by email
const ( //EmailVerificationKindSignIn is the sign in by email process EmailVerificationKindSignIn EmailVerificationKind = 1 //EmailVerificationKindSignUp is the sign up (create tenant) by name and email process EmailVerificationKindSignUp EmailVerificationKind = 2 //EmailVerificationKindChangeEmail is the change user email process EmailVerificationKindChangeEmail EmailVerificationKind = 3 //EmailVerificationKindUserInvitation is the sign in invitation sent to an user EmailVerificationKindUserInvitation EmailVerificationKind = 4 )
type NotificationChannel ¶
type NotificationChannel int
NotificationChannel represents the medium that the notification is sent
var ( //NotificationChannelWeb is a in-app notification NotificationChannelWeb NotificationChannel = 1 //NotificationChannelEmail is an email notification NotificationChannelEmail NotificationChannel = 2 )
type NotificationEvent ¶
type NotificationEvent struct { UserSettingsKeyName string DefaultSettingValue string RequiresSubscriptionUserRoles []Role DefaultEnabledUserRoles []Role Validate func(string) bool }
NotificationEvent represents all possible notification events
type PostStatus ¶
type PostStatus int
PostStatus is the status of a given post
var ( //PostOpen is the default status PostOpen PostStatus //PostStarted is used when the post has been accepted and work is in progress PostStarted PostStatus = 1 //PostCompleted is used when the post has been accepted and already implemented PostCompleted PostStatus = 2 //PostDeclined is used when organizers decide to decline an post PostDeclined PostStatus = 3 //PostPlanned is used when organizers have accepted an post and it's on the roadmap PostPlanned PostStatus = 4 //PostDuplicate is used when the post has already been posted before PostDuplicate PostStatus = 5 //PostDeleted is used when the post is completely removed from the site and should never be shown again PostDeleted PostStatus = 6 )
func (PostStatus) MarshalText ¶
func (status PostStatus) MarshalText() ([]byte, error)
MarshalText returns the Text version of the post status
func (PostStatus) Name ¶
func (status PostStatus) Name() string
Name returns the name of a post status
func (*PostStatus) UnmarshalText ¶
func (status *PostStatus) UnmarshalText(text []byte) error
UnmarshalText parse string into a post status
type Role ¶
type Role int
Role is the role of a user inside a tenant
func (Role) MarshalText ¶
MarshalText returns the Text version of the user role
func (*Role) UnmarshalText ¶
UnmarshalText parse string into a user role
type TenantStatus ¶
type TenantStatus int
TenantStatus is the status of a tenant
var ( //TenantActive is the default status for most tenants TenantActive TenantStatus = 1 //TenantPending is used for signup via email that requires user confirmation TenantPending TenantStatus = 2 //TenantLocked is used to set tenant on a read-only mode TenantLocked TenantStatus = 3 //TenantDisabled is used to block all access TenantDisabled TenantStatus = 4 )
func (TenantStatus) String ¶
func (status TenantStatus) String() string
String returns the string version of the tenant status
type UserStatus ¶
type UserStatus int
UserStatus is the status of a user
var ( //UserActive is the default status for users UserActive UserStatus = 1 //UserDeleted is used for users that chose to delete their accounts UserDeleted UserStatus = 2 //UserBlocked is used for users that have been blocked by staff members UserBlocked UserStatus = 3 )
func (UserStatus) MarshalText ¶
func (status UserStatus) MarshalText() ([]byte, error)
MarshalText returns the Text version of the user status
func (UserStatus) String ¶
func (status UserStatus) String() string
String returns the string version of the user status
func (*UserStatus) UnmarshalText ¶
func (status *UserStatus) UnmarshalText(text []byte) error
UnmarshalText parse string into a user status
type WebhookStatus ¶
type WebhookStatus int
WebhookStatus is the status of a webhook
const ( // WebhookEnabled means the webhook can be triggered WebhookEnabled WebhookStatus = 1 // WebhookDisabled means the webhook cannot be triggered WebhookDisabled WebhookStatus = 2 // WebhookFailed means an error occured when the webhook was previously triggered and has been disabled WebhookFailed WebhookStatus = 3 )
func (WebhookStatus) MarshalText ¶
func (status WebhookStatus) MarshalText() ([]byte, error)
MarshalText returns the Text version of the webhook status
func (WebhookStatus) Name ¶
func (status WebhookStatus) Name() string
Name returns the name of a webhook status
func (*WebhookStatus) UnmarshalText ¶
func (status *WebhookStatus) UnmarshalText(text []byte) error
UnmarshalText parse string into a webhook status
type WebhookType ¶
type WebhookType int
WebhookType is the type of a webhook
const ( // WebhookNewPost is triggered on new post WebhookNewPost WebhookType = 1 // WebhookNewComment is triggered on new comment WebhookNewComment WebhookType = 2 // WebhookChangeStatus is triggered on post status change WebhookChangeStatus WebhookType = 3 // WebhookDeletePost is triggered on post deletion WebhookDeletePost WebhookType = 4 )
func (WebhookType) MarshalText ¶
func (t WebhookType) MarshalText() ([]byte, error)
MarshalText returns the Text version of the webhook type
func (WebhookType) Name ¶
func (t WebhookType) Name() string
Name returns the name of a webhook status
func (*WebhookType) UnmarshalText ¶
func (t *WebhookType) UnmarshalText(text []byte) error
UnmarshalText parse string into a webhook type