Documentation
¶
Index ¶
- Constants
- type AccessControl
- type AuthChallenge
- type Base
- type ChallengeStatusType
- type ChallengeType
- type Grammar
- type Language
- type Modifier
- type OTP
- type Permission
- type PermissionKeyType
- type Role
- type RoleKeyType
- type Sentence
- type SentenceLevelType
- type StatusType
- type TOTPKey
- type User
- type UserGenderType
- type UserStatusType
Constants ¶
View Source
const ( StatusActiveStr = "ACTIVE" StatusDisabledStr = "DISABLED" StatusUnpublishedStr = "UNPUBLISHED" StatusDraftStr = "DRAFT" )
View Source
const ( ChallengeTOTPStr = "TOTP" ChallengeRecoveryCodesStr = "RECOVERY_CODES" )
View Source
const ( ChallengeEnableStr = "ENABLE" ChallengeDisabledStr = "DISABLED" )
View Source
const ( UserStatusUnknownStr = "unknown" UserStatusActiveStr = "ACTIVE" UserStatusInactiveStr = "INACTIVE" UserStatusUnverifiedStr = "UNVERIFIED" UserStatusBannedStr = "BANNED" )
View Source
const ( UserGenderMaleStr = "MALE" UserGenderFemaleStr = "FEMALE" UserGenderOtherStr = "OTHER" UserGenderPreferNotToSayStr = "PREFER_NOT_TO_SAY" )
View Source
const UnknownStr = "UNKNOWN"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessControl ¶
type AuthChallenge ¶
type AuthChallenge struct { Type ChallengeType Status ChallengeStatusType }
type ChallengeStatusType ¶
type ChallengeStatusType string
const ( ChallengeEnable ChallengeStatusType = "ENABLE" ChallengeDisabled ChallengeStatusType = "DISABLED" )
func (ChallengeStatusType) String ¶
func (r ChallengeStatusType) String() string
type ChallengeType ¶
type ChallengeType string
const ( ChallengeTOTP ChallengeType = ChallengeTOTPStr ChallengeRecoveryCodes ChallengeType = ChallengeRecoveryCodesStr )
func (ChallengeType) String ¶
func (r ChallengeType) String() string
type Permission ¶
type PermissionKeyType ¶
type PermissionKeyType string
const ( PermissionKeyNone PermissionKeyType = "NONE" PermissionKeyCreateUser PermissionKeyType = "CREATE_USER" PermissionKeyReadUser PermissionKeyType = "READ_USER" PermissionKeyUpdateUser PermissionKeyType = "UPDATE_USER" PermissionKeyDeleteUser PermissionKeyType = "DELETE_USER" PermissionKeyCreateRole PermissionKeyType = "CREATE_ROLE" PermissionKeyReadRole PermissionKeyType = "READ_ROLE" PermissionKeyUpdateRole PermissionKeyType = "UPDATE_ROLE" PermissionKeyDeleteRole PermissionKeyType = "DELETE_ROLE" PermissionKeyReadPermission PermissionKeyType = "READ_PERMISSION" PermissionKeySyncRolesWithUser PermissionKeyType = "SYNC_ROLES_WITH_USER" PermissionKeyReadUserRoles PermissionKeyType = "READ_USER_ROLES" PermissionKeySyncPermissionsWithRole PermissionKeyType = "SYNC_PERMISSIONS_WITH_ROLE" PermissionKeyReadRolePermissions PermissionKeyType = "READ_ROLE_PERMISSIONS" )
type Role ¶
type Role struct { Base Modifier Title string Key RoleKeyType Description string IsDefault bool Permissions []*Permission }
type RoleKeyType ¶
type RoleKeyType string
const ( RoleKeySuperAdmin RoleKeyType = "SUPER_ADMIN" RoleKeyAdmin RoleKeyType = "ADMIN" RoleKeyManager RoleKeyType = "MANAGER" RoleKeyAccountant RoleKeyType = "ACCOUNTANT" RoleKeySupplier RoleKeyType = "SUPPLIER" RoleKeySales RoleKeyType = "SALES" RoleKeyStaff RoleKeyType = "STAFF" RoleKeyUser RoleKeyType = "USER" )
type Sentence ¶
type Sentence struct { Base Modifier Text string Grammar Grammar Level SentenceLevelType Status StatusType }
type SentenceLevelType ¶
type SentenceLevelType string
const ( SentenceLevelEasy SentenceLevelType = "EASY" SentenceLevelNormal SentenceLevelType = "NORMAL" SentenceLevelHard SentenceLevelType = "HARD" )
type StatusType ¶
type StatusType string
const ( StatusActive StatusType = StatusActiveStr StatusDisabled StatusType = StatusDisabledStr StatusUnpublished StatusType = StatusUnpublishedStr StatusDraft StatusType = StatusDraftStr )
type User ¶
type User struct { Base Modifier FirstName *string LastName *string Email string Password *string Avatar *string Status UserStatusType WelcomeMessageSent bool GoogleID *string TOTPSecret *string Gender UserGenderType AuthChallenges []AuthChallenge }
func (*User) AuthChallengeTOTP ¶
func (r *User) AuthChallengeTOTP()
func (*User) GetFullName ¶
func (*User) SetFirstName ¶
func (r *User) SetFirstName(firstName sql.NullString) *User
func (*User) SetGoogleID ¶
func (r *User) SetGoogleID(googleID sql.NullString) *User
func (*User) SetLastName ¶
func (r *User) SetLastName(lastName sql.NullString) *User
type UserGenderType ¶
type UserGenderType string
const ( UserGenderMale UserGenderType = UserGenderMaleStr UserGenderFemale UserGenderType = UserGenderFemaleStr UserGenderOther UserGenderType = UserGenderOtherStr UserGenderPreferNotToSay UserGenderType = UserGenderPreferNotToSayStr )
func ToUserGenderType ¶
func ToUserGenderType(gender string) UserGenderType
func (*UserGenderType) String ¶
func (r *UserGenderType) String() string
type UserStatusType ¶
type UserStatusType string
const ( UserStatusUnknown UserStatusType = UserStatusUnknownStr UserStatusActive UserStatusType = UserStatusActiveStr UserStatusInactive UserStatusType = UserStatusInactiveStr UserStatusUnverified UserStatusType = UserStatusUnverifiedStr UserStatusBanned UserStatusType = UserStatusBannedStr )
func ToUserStatus ¶
func ToUserStatus(status string) UserStatusType
func (UserStatusType) String ¶
func (r UserStatusType) String() string
Click to show internal directories.
Click to hide internal directories.