services

package
v0.0.0-...-d1f5409 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2024 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

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 AddEvent

func AddEvent(user models.Account, event, target, ip, ua string) models.ActionEvent

func AddNotifySubscriber

func AddNotifySubscriber(user models.Account, provider, device, ua string) (models.NotificationSubscriber, error)

func Authenticate

func Authenticate(access, refresh string, depth int) (user models.Account, newAccess, newRefresh string, err error)

func CheckOnline

func CheckOnline(user models.Account) bool

func ConfirmAccount

func ConfirmAccount(code string) error

func CreateAccount

func CreateAccount(name, nick, email, password string) (models.Account, error)

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 GetAccount

func GetAccount(id uint) (models.Account, error)

func GetAuthContext

func GetAuthContext(jti string) (models.AuthContext, error)

func GetFactorCode

func GetFactorCode(factor models.AuthFactor) (bool, error)

func GetFriend

func GetFriend(anysideId uint) (models.AccountFriendship, 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 LookupAccount

func LookupAccount(id string) (models.Account, error)

func LookupChallenge

func LookupChallenge(id uint) (models.AuthChallenge, error)

func LookupChallengeWithFingerprint

func LookupChallengeWithFingerprint(id uint, ip string, ua string) (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 RevokeAuthContext(jti string) error

func SendMail

func SendMail(target string, subject string, content string) error

func SendMailHTML

func SendMailHTML(target string, subject string, content string) error

func ValidateMagicToken

func ValidateMagicToken(code string, mode models.MagicTokenType) (models.MagicToken, error)

Types

type WsPushRequest

type WsPushRequest struct {
	Payload     []byte
	RecipientID uint
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL