Documentation ¶
Index ¶
- Constants
- type Account
- type AccountContact
- type AccountContactType
- type AccountFriendship
- type AccountPage
- type AccountPageLinks
- type AccountProfile
- type ActionEvent
- type AuthContext
- type AuthFactor
- type AuthFactorType
- type AuthTicket
- type BaseModel
- type FriendshipStatus
- type JSONMap
- type MagicToken
- type MagicTokenType
- type Notification
- type NotificationLink
- type NotificationSubscriber
- type Realm
- type RealmMember
- type ThirdClient
Constants ¶
View Source
const ( PasswordAuthFactor = AuthFactorType(iota) EmailPasswordFactor )
View Source
const ( FriendshipPending = FriendshipStatus(iota) FriendshipActive FriendshipBlocked )
View Source
const ( ConfirmMagicToken = MagicTokenType(iota) RegistrationMagicToken )
View Source
const (
EmailAccountContact = AccountContactType(iota)
)
View Source
const (
NotifySubscriberFirebase = "firebase"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { BaseModel Name string `json:"name" gorm:"uniqueIndex"` Nick string `json:"nick"` Description string `json:"description"` Avatar string `json:"avatar"` Banner string `json:"banner"` ConfirmedAt *time.Time `json:"confirmed_at"` PowerLevel int `json:"power_level"` Profile AccountProfile `json:"profile"` PersonalPage AccountPage `json:"personal_page"` Contacts []AccountContact `json:"contacts"` RealmIdentities []RealmMember `json:"realm_identities"` Tickets []AuthTicket `json:"tickets"` Factors []AuthFactor `json:"factors"` Events []ActionEvent `json:"events"` MagicTokens []MagicToken `json:"-" gorm:"foreignKey:AssignTo"` ThirdClients []ThirdClient `json:"clients"` Notifications []Notification `json:"notifications" gorm:"foreignKey:RecipientID"` NotifySubscribers []NotificationSubscriber `json:"notify_subscribers"` Friendships []AccountFriendship `json:"friendships" gorm:"foreignKey:AccountID"` RelatedFriendships []AccountFriendship `json:"related_friendships" gorm:"foreignKey:RelatedID"` }
func (Account) GetAvatarPath ¶
func (Account) GetBannerPath ¶
func (Account) GetPrimaryEmail ¶
func (v Account) GetPrimaryEmail() AccountContact
type AccountContact ¶
type AccountContactType ¶
type AccountContactType = int8
type AccountFriendship ¶
type AccountPage ¶
type AccountPageLinks ¶
type AccountProfile ¶
type ActionEvent ¶
type AuthContext ¶
type AuthContext struct { Ticket AuthTicket `json:"ticket"` Account Account `json:"account"` ExpiredAt time.Time `json:"expired_at"` }
type AuthFactor ¶
type AuthFactorType ¶
type AuthFactorType = int8
type AuthTicket ¶
type AuthTicket struct { BaseModel Location string `json:"location"` IpAddress string `json:"ip_address"` UserAgent string `json:"user_agent"` RequireMFA bool `json:"require_mfa"` RequireAuthenticate bool `json:"require_authenticate"` Claims datatypes.JSONSlice[string] `json:"claims"` Audiences datatypes.JSONSlice[string] `json:"audiences"` GrantToken *string `json:"grant_token"` AccessToken *string `json:"access_token"` RefreshToken *string `json:"refresh_token"` ExpiredAt *time.Time `json:"expired_at"` AvailableAt *time.Time `json:"available_at"` LastGrantAt *time.Time `json:"last_grant_at"` ClientID *uint `json:"client_id"` AccountID uint `json:"account_id"` }
func (AuthTicket) IsAvailable ¶
func (v AuthTicket) IsAvailable() error
type FriendshipStatus ¶
type FriendshipStatus = int8
type MagicToken ¶
type MagicTokenType ¶
type MagicTokenType = int8
type Notification ¶
type Notification struct { BaseModel Subject string `json:"subject"` Content string `json:"content"` Links datatypes.JSONSlice[NotificationLink] `json:"links"` IsImportant bool `json:"is_important"` IsRealtime bool `json:"is_realtime" gorm:"-"` ReadAt *time.Time `json:"read_at"` SenderID *uint `json:"sender_id"` RecipientID uint `json:"recipient_id"` }
type NotificationLink ¶
NotificationLink Used to embed into notify and render actions
type NotificationSubscriber ¶
type RealmMember ¶
type ThirdClient ¶
type ThirdClient struct { BaseModel Alias string `json:"alias" gorm:"uniqueIndex"` Name string `json:"name"` Description string `json:"description"` Secret string `json:"secret"` Urls datatypes.JSONSlice[string] `json:"urls"` Callbacks datatypes.JSONSlice[string] `json:"callbacks"` Sessions []AuthTicket `json:"tickets" gorm:"foreignKey:ClientID"` Notifications []Notification `json:"notifications" gorm:"foreignKey:SenderID"` IsDraft bool `json:"is_draft"` AccountID *uint `json:"account_id"` }
Click to show internal directories.
Click to hide internal directories.