Documentation ¶
Index ¶
- Constants
- type AbuseReport
- type Account
- type AccountContact
- type AccountContactType
- type AccountGroup
- type AccountGroupMember
- type AccountProfile
- type AccountRelationship
- type ActionEvent
- type ApiKey
- type AuditRecord
- type AuthConfig
- type AuthContext
- type AuthFactor
- type AuthFactorType
- type AuthTicket
- type Badge
- type BaseModel
- type CheckInRecord
- type JSONMap
- type MagicToken
- type MagicTokenType
- type Notification
- type NotificationSubscriber
- type PreferenceAuth
- type PreferenceNotification
- type Realm
- type RealmMember
- type RelationshipStatus
- type Status
- type StatusAttitude
- type ThirdClient
Constants ¶
View Source
const ( PasswordAuthFactor = AuthFactorType(iota) EmailPasswordFactor )
View Source
const ( NotifySubscriberFirebase = "firebase" NotifySubscriberAPNs = "apple" )
View Source
const ( RelationshipPending = RelationshipStatus(iota) RelationshipFriend RelationshipBlocked RelationshipWaiting )
View Source
const ( ReportStatusPending = "pending" ReportStatusReviewing = "reviewing" ReportStatusConfirmed = "confirmed" ReportStatusRejected = "rejected" ReportStatusProcessed = "processed" )
View Source
const ( AttitudeNeutral = StatusAttitude(iota) AttitudePositive AttitudeNegative )
View Source
const ( ConfirmMagicToken = MagicTokenType(iota) RegistrationMagicToken ResetPasswordMagicToken DeleteAccountMagicToken )
View Source
const (
EmailAccountContact = AccountContactType(iota)
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbuseReport ¶
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"` SuspendedAt *time.Time `json:"suspended_at"` PermNodes datatypes.JSONMap `json:"perm_nodes"` AutomatedBy *Account `json:"automated_by" gorm:"foreignKey:AutomatedID"` AutomatedID *uint `json:"automated_id"` AffiliatedTo *Realm `json:"affiliated_to" gorm:"foreignKey:AffiliatedID"` AffiliatedID *uint `json:"affiliated_id"` Profile AccountProfile `json:"profile,omitempty"` Contacts []AccountContact `json:"contacts,omitempty"` Badges []Badge `json:"badges,omitempty"` Tickets []AuthTicket `json:"tickets,omitempty"` Factors []AuthFactor `json:"factors,omitempty"` Relations []AccountRelationship `json:"relations,omitempty" gorm:"foreignKey:AccountID"` }
func (Account) EncodeToUserInfo ¶
func (Account) GetPrimaryEmail ¶
func (v Account) GetPrimaryEmail() AccountContact
type AccountContact ¶
type AccountContactType ¶
type AccountContactType = int8
type AccountGroup ¶
type AccountGroupMember ¶
type AccountGroupMember struct { BaseModel Account Account `json:"account"` Group AccountGroup `json:"group"` AccountID uint `json:"account_id"` GroupID uint `json:"group_id"` }
type AccountProfile ¶
type AccountRelationship ¶
type ActionEvent ¶
type AuditRecord ¶
type AuthConfig ¶
type AuthConfig struct {
MaximumAuthSteps int `json:"maximum_auth_steps" validate:"required,min=1,max=99"`
}
type AuthContext ¶
type AuthContext struct { Ticket AuthTicket `json:"ticket"` Account Account `json:"account"` }
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"` StepRemain int `json:"step_remain"` Claims datatypes.JSONSlice[string] `json:"claims"` Audiences datatypes.JSONSlice[string] `json:"audiences"` FactorTrail datatypes.JSONSlice[int] `json:"factor_trail"` 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"` Nonce *string `json:"nonce"` ClientID *uint `json:"client_id"` Account Account `json:"account"` AccountID uint `json:"account_id"` }
func (AuthTicket) IsAvailable ¶
func (v AuthTicket) IsAvailable() error
func (AuthTicket) IsCanBeAvailble ¶
func (v AuthTicket) IsCanBeAvailble() error
type CheckInRecord ¶
type CheckInRecord struct { BaseModel ResultTier int `json:"result_tier"` ResultExperience int `json:"result_experience"` // The result modifiers are some random tips that will show up in the client; // This field is to use to make sure the tips will be the same when the client is reloaded. // For now, this modifier slice will contain four random numbers from 0 to 1024. // Client should mod this modifier by the length of total available tips. ResultModifiers datatypes.JSONSlice[int] `json:"result_modifiers"` Account Account `json:"account"` AccountID uint `json:"account_id"` }
type MagicToken ¶
type MagicTokenType ¶
type MagicTokenType = int8
type Notification ¶
type Notification struct { BaseModel Topic string `json:"topic"` Title string `json:"title"` Subtitle string `json:"subtitle"` Body string `json:"body"` Metadata datatypes.JSONMap `json:"metadata"` Priority int `json:"priority"` SenderID *uint `json:"sender_id"` Account Account `json:"account"` AccountID uint `json:"account_id"` ReadAt *time.Time `json:"read_at"` }
func NewNotificationFromPushkit ¶
func NewNotificationFromPushkit(pk pushkit.Notification) Notification
func (Notification) EncodeToPushkit ¶
func (v Notification) EncodeToPushkit() pushkit.Notification
type NotificationSubscriber ¶
type PreferenceAuth ¶
type PreferenceNotification ¶
type Realm ¶
type Realm struct { BaseModel Alias string `json:"alias" gorm:"uniqueIndex"` Name string `json:"name"` Description string `json:"description"` Members []RealmMember `json:"members"` Avatar *string `json:"avatar"` Banner *string `json:"banner"` AccessPolicy datatypes.JSONMap `json:"access_policy"` IsPublic bool `json:"is_public"` IsCommunity bool `json:"is_community"` AccountID uint `json:"account_id"` }
func NewRealmFromProto ¶
type RealmMember ¶
type RealmMember struct { BaseModel RealmID uint `json:"realm_id"` AccountID uint `json:"account_id"` Realm Realm `json:"realm"` Account Account `json:"account"` PowerLevel int `json:"power_level"` }
func NewRealmMemberFromProto ¶
func NewRealmMemberFromProto(proto *proto.RealmMemberInfo) RealmMember
type RelationshipStatus ¶
type RelationshipStatus = int8
type StatusAttitude ¶
type StatusAttitude = uint8
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"` IsDraft bool `json:"is_draft"` AccountID *uint `json:"account_id"` }
Click to show internal directories.
Click to hide internal directories.