Documentation ¶
Index ¶
- Variables
- func CheckAccountStatus(accountStatus string) bool
- func CheckAccountType(accountType string) bool
- func CheckClientID(clientID string) bool
- func CheckIdentityStatus(status string) bool
- func CheckIdentityType(identityType string) bool
- func CheckTokenType(tokenType string) bool
- type Account
- type AccountStatus
- type AccountType
- type ClientID
- type EmailNotificationScopeType
- type EmailNotifications
- type File
- type FileModerationStatus
- type Identity
- type IdentityStatus
- type IdentityType
- type LinkedEntityType
- type MonthlyStats
- type MonthlyStatsType
- type Notifications
- type Profile
- type Session
- type SessionTokens
- type Settings
- type SocialLink
- type SocialLinkType
- type SocialNetworkType
- type Token
- type TokenStatus
- type TokenType
- type User
- type UserIdentity
- type UserType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrIdentityEmptyEmail = errors.New("identity email can't be empty") ErrIdentityIncorrectEmail = errors.New("identity email is incorrect") ErrIdentityIncorrectType = errors.New("identity type is incorrect") )
View Source
var (
ErrSessionIncorrectClientID = errors.New("client ID is incorrect")
)
Functions ¶
func CheckAccountStatus ¶
func CheckAccountType ¶
func CheckClientID ¶
func CheckIdentityStatus ¶
func CheckIdentityType ¶
func CheckTokenType ¶
Types ¶
type Account ¶
type Account struct { ID uuid.UUID `json:"-"` AccountStatus AccountStatus `json:"-"` AccountType AccountType `json:"-"` AccountName string `json:"-"` Profile Profile `json:"-"` Settings Settings `json:"-"` LastIP string `json:"-"` LastLogin time.Time `json:"-"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
func (*Account) SetAccountStatus ¶
func (a *Account) SetAccountStatus(accountStatus AccountStatus)
func (*Account) SetAccountType ¶
func (a *Account) SetAccountType(accountType AccountType)
type AccountStatus ¶
type AccountStatus string
const ( AccountStatusUnconfirmed AccountStatus = "unconfirmed" AccountStatusConfirmed AccountStatus = "confirmed" AccountStatusDeleted AccountStatus = "deleted" AccountStatusBanned AccountStatus = "banned" )
func (AccountStatus) String ¶
func (a AccountStatus) String() string
type AccountType ¶
type AccountType string
const ( AccountTypeFree AccountType = "free" AccountTypeCommercial AccountType = "commercial" )
func (AccountType) String ¶
func (a AccountType) String() string
type EmailNotificationScopeType ¶
type EmailNotificationScopeType string
const ( // Auth confirm, change email and so on EmailNotificationScopeTypeBase EmailNotificationScopeType = "base" // Reminders about started challenges EmailNotificationScopeTypeReminders EmailNotificationScopeType = "reminders" // News about new challenges, new achievements EmailNotificationScopeTypeNews EmailNotificationScopeType = "news" )
func (EmailNotificationScopeType) String ¶
func (e EmailNotificationScopeType) String() string
type EmailNotifications ¶
type EmailNotifications struct { Email string `json:"-"` Scope []EmailNotificationScopeType `json:"-"` }
type File ¶
type File struct { ID uuid.UUID `json:"-"` LinkedEntityID uuid.UUID `json:"-"` LinkedEntityType LinkedEntityType `json:"-"` AuthorID uuid.UUID `json:"-"` ModerationStatus FileModerationStatus `json:"-"` Name string `json:"-"` Extensions []string `json:"-"` Description string `json:"-"` Size int `json:"-"` Copyright string `json:"-"` }
func ParseFileFromBytes ¶
func (*File) ConvertToMap ¶
func (*File) GetFileNames ¶
type FileModerationStatus ¶
type FileModerationStatus string
const ( FileModerationStatusRejected FileModerationStatus = "rejected" FileModerationStatusInProgress FileModerationStatus = "in_progress" FileModerationStatusApproved FileModerationStatus = "approved" FileModerationStatusNotStarted FileModerationStatus = "not_started" )
func (FileModerationStatus) String ¶
func (f FileModerationStatus) String() string
type Identity ¶
type Identity struct { ID uuid.UUID `json:"-"` AccountID uuid.UUID `json:"-"` IdentityType IdentityType `json:"-"` IdentityStatus IdentityStatus `json:"-"` GoogleSocialID string `json:"-"` FacebookSocialID string `json:"-"` Email string `json:"-"` PasswordHash string `json:"-"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
func (*Identity) SetIdentityStatus ¶
func (i *Identity) SetIdentityStatus(status IdentityStatus)
func (*Identity) SetIdentityType ¶
func (i *Identity) SetIdentityType(identityType IdentityType)
type IdentityStatus ¶
type IdentityStatus string
const ( IdentityStatusUnconfirmed IdentityStatus = "unconfirmed" IdentityStatusConfirmed IdentityStatus = "confirmed" )
func (IdentityStatus) String ¶
func (i IdentityStatus) String() string
type IdentityType ¶
type IdentityType string
const ( IdentityTypeEmail IdentityType = "email" IdentityTypeFacebook IdentityType = "facebook" IdentityTypeGoogle IdentityType = "google" )
func (IdentityType) String ¶
func (i IdentityType) String() string
type LinkedEntityType ¶
type LinkedEntityType string
const (
LinkedEntityTypeAccountAvatar LinkedEntityType = "account_avatar"
)
func (LinkedEntityType) String ¶
func (l LinkedEntityType) String() string
type MonthlyStats ¶
type MonthlyStatsType ¶
type MonthlyStatsType string
const ( MonthlyStatsTypeAcceptedChallenges MonthlyStatsType = "acceptedChallenges" MonthlyStatsTypeAchivedChallenges MonthlyStatsType = "achivedChallenges" MonthlyStatsTypeCreatedChallenges MonthlyStatsType = "createdChallenges" MonthlyStatsTypeFinishedTasks MonthlyStatsType = "finishedTasks" MonthlyStatsTypePosts MonthlyStatsType = "posts" MonthlyStatsTypeFeedbacks MonthlyStatsType = "feedbacks" )
type Notifications ¶
type Notifications struct {
Email EmailNotifications `json:"-"`
}
type Profile ¶
type Profile struct { FirstName string `json:"-"` LastName string `json:"-"` Country string `json:"-"` City string `json:"-"` Gender string `json:"-"` Birthday time.Time `json:"-"` Description string `json:"-"` SocialLinks []SocialLink `json:"-"` AvatarURL string `json:"-"` Interests []string `json:"-"` }
type SessionTokens ¶
type Settings ¶
type Settings struct {
Notifications Notifications `json:"-"`
}
type SocialLink ¶
type SocialLink struct { Type SocialLinkType URL string }
type SocialLinkType ¶
type SocialLinkType string
const ( SocialLinkTypeFacebook SocialLinkType = "facebook" SocialLinkTypeGoogle SocialLinkType = "google" SocialLinkTypeInstagram SocialLinkType = "instagram" SocialLinkTypeTwitter SocialLinkType = "twitter" )
func (SocialLinkType) String ¶
func (s SocialLinkType) String() string
type SocialNetworkType ¶
type SocialNetworkType string
const ( SocialNetworkTypeGoogle SocialNetworkType = "google" SocialNetworkTypeFacebook SocialNetworkType = "facebook" )
type TokenStatus ¶
type TokenStatus string
const ( TokenStatusActive TokenStatus = "active" TokenStatusUsed TokenStatus = "used" )
func (TokenStatus) String ¶
func (t TokenStatus) String() string
type User ¶
type User struct { ID uuid.UUID AccountType AccountType AccountStatus AccountStatus AccountName string Profile Profile Identities []UserIdentity LastIP string LastLogin time.Time CreatedAt time.Time UpdatedAt time.Time Settings Settings UserType UserType AvatarFile File MediaPrefix string }
func (*User) MarshalJSON ¶
type UserIdentity ¶
type UserIdentity struct { IdentityType IdentityType Email string IdentityStatus IdentityStatus }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.