Documentation ¶
Index ¶
- Constants
- Variables
- func AddEvent(user models.Account, event, target, ip, ua string) models.ActionEvent
- func AddNotifySubscriber(user models.Account, provider, device, ua string) (models.NotificationSubscriber, error)
- func Authenticate(access, refresh string, depth int) (user models.Account, newAccess, newRefresh string, err error)
- func CheckOnline(user models.Account) bool
- func ConfirmAccount(code string) error
- func CreateAccount(name, nick, email, password string) (models.Account, error)
- func DeleteFriend(relationship models.AccountFriendship) error
- func DoAutoAuthCleanup()
- func DoAutoDatabaseCleanup()
- func DoAutoSignoff()
- func EditFriend(relationship models.AccountFriendship) (models.AccountFriendship, error)
- func EditFriendWithCheck(relationship models.AccountFriendship, user models.Account, ...) (models.AccountFriendship, error)
- func GetAccount(id uint) (models.Account, error)
- func GetAuthContext(jti string) (models.AuthContext, error)
- func GetFactorCode(factor models.AuthFactor) (bool, error)
- func GetFriend(anysideId uint) (models.AccountFriendship, error)
- func GetFriendWithTwoSides(userId, relatedId uint, noPreload ...bool) (models.AccountFriendship, error)
- func GetThirdClient(id string) (models.ThirdClient, error)
- func GetThirdClientWithSecret(id, secret string) (models.ThirdClient, error)
- func GrantAuthContext(jti string) (models.AuthContext, error)
- func ListFriend(anyside models.Account, status models.FriendshipStatus) ([]models.AccountFriendship, error)
- func LookupAccount(id string) (models.Account, error)
- func LookupChallenge(id uint) (models.AuthChallenge, error)
- func LookupChallengeWithFingerprint(id uint, ip string, ua string) (models.AuthChallenge, error)
- func LookupFactor(id uint) (models.AuthFactor, error)
- func LookupFactorsByUser(uid uint) ([]models.AuthFactor, error)
- func LookupSessionWithToken(tokenId string) (models.AuthSession, error)
- func NewFriend(user models.Account, related models.Account, status models.FriendshipStatus) (models.AccountFriendship, error)
- func NewMagicToken(mode models.MagicTokenType, assignTo *models.Account, expiredAt *time.Time) (models.MagicToken, error)
- func NewNotification(notification models.Notification) error
- func NotifyMagicToken(token models.MagicToken) error
- func PushNotification(notification models.Notification) error
- func RevokeAuthContext(jti string) error
- func SendMail(target string, subject string, content string) error
- func SendMailHTML(target string, subject string, content string) error
- func ValidateMagicToken(code string, mode models.MagicTokenType) (models.MagicToken, error)
- type WsPushRequest
Constants ¶
View Source
const ConfirmRegistrationTemplate = `` /* 600-byte string literal not displayed */
View Source
const EmailPasswordTemplate = `` /* 534-byte string literal not displayed */
Variables ¶
View Source
var WsConn = make(map[uint][]*websocket.Conn)
Functions ¶
func AddNotifySubscriber ¶
func Authenticate ¶
func CheckOnline ¶
func ConfirmAccount ¶
func DeleteFriend ¶
func DeleteFriend(relationship models.AccountFriendship) error
func DoAutoAuthCleanup ¶
func DoAutoAuthCleanup()
func DoAutoDatabaseCleanup ¶
func DoAutoDatabaseCleanup()
func DoAutoSignoff ¶
func DoAutoSignoff()
func EditFriend ¶
func EditFriend(relationship models.AccountFriendship) (models.AccountFriendship, error)
func EditFriendWithCheck ¶
func EditFriendWithCheck(relationship models.AccountFriendship, user models.Account, originalStatus models.FriendshipStatus) (models.AccountFriendship, error)
func GetAuthContext ¶
func GetAuthContext(jti string) (models.AuthContext, error)
func GetFactorCode ¶
func GetFactorCode(factor models.AuthFactor) (bool, error)
func GetFriendWithTwoSides ¶
func GetFriendWithTwoSides(userId, relatedId uint, noPreload ...bool) (models.AccountFriendship, error)
func GetThirdClient ¶
func GetThirdClient(id string) (models.ThirdClient, error)
func GetThirdClientWithSecret ¶
func GetThirdClientWithSecret(id, secret string) (models.ThirdClient, error)
func GrantAuthContext ¶
func GrantAuthContext(jti string) (models.AuthContext, error)
func ListFriend ¶
func ListFriend(anyside models.Account, status models.FriendshipStatus) ([]models.AccountFriendship, error)
func LookupChallenge ¶
func LookupChallenge(id uint) (models.AuthChallenge, error)
func LookupFactor ¶
func LookupFactor(id uint) (models.AuthFactor, error)
func LookupFactorsByUser ¶
func LookupFactorsByUser(uid uint) ([]models.AuthFactor, error)
func LookupSessionWithToken ¶
func LookupSessionWithToken(tokenId string) (models.AuthSession, error)
func NewFriend ¶
func NewFriend(user models.Account, related models.Account, status models.FriendshipStatus) (models.AccountFriendship, error)
func NewMagicToken ¶
func NewMagicToken(mode models.MagicTokenType, assignTo *models.Account, expiredAt *time.Time) (models.MagicToken, error)
func NewNotification ¶
func NewNotification(notification models.Notification) error
func NotifyMagicToken ¶
func NotifyMagicToken(token models.MagicToken) error
func PushNotification ¶
func PushNotification(notification models.Notification) error
func RevokeAuthContext ¶
func ValidateMagicToken ¶
func ValidateMagicToken(code string, mode models.MagicTokenType) (models.MagicToken, error)
Types ¶
type WsPushRequest ¶
Click to show internal directories.
Click to hide internal directories.