enum

package
v0.19.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2021 License: AGPL-3.0 Imports: 1 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
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,
	}
)
View Source
var (
	//OAuthConfigDisabled is used to disable an OAuthConfig for signin
	OAuthConfigDisabled = 1
	//OAuthConfigEnabled is used to enable an OAuthConfig for public use
	OAuthConfigEnabled = 2
)
View Source
var (
	//SubscriberInactive means that the user cancelled the subscription
	SubscriberInactive = 0
	//SubscriberActive means that the subscription is active
	SubscriberActive = 1
)
View Source
var (
	//TenantActive is the default status for most tenants
	TenantActive = 1
	//TenantPending is used for signup via email that requires user confirmation
	TenantPending = 2
	//TenantLocked is used to set tenant on a read-only mode
	TenantLocked = 3
	//TenantDisabled is used to block all access
	TenantDisabled = 4
)

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
)

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 user status

func (*AvatarType) UnmarshalText

func (t *AvatarType) UnmarshalText(text []byte) error

UnmarshalText parse string into a avatar type

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

const (
	//RoleVisitor is the basic role for every user
	RoleVisitor Role = 1
	//RoleCollaborator has limited access to administrative console
	RoleCollaborator Role = 2
	//RoleAdministrator has full access to administrative console
	RoleAdministrator Role = 3
)

func (Role) MarshalText

func (role Role) MarshalText() ([]byte, error)

MarshalText returns the Text version of the user role

func (*Role) UnmarshalText

func (role *Role) UnmarshalText(text []byte) error

UnmarshalText parse string into a user role

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) UnmarshalText

func (status *UserStatus) UnmarshalText(text []byte) error

UnmarshalText parse string into a user status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL