Documentation
¶
Index ¶
- func IsRootUser(user *models.User) bool
- type AuditorInfo
- type AuditorService
- type AuthData
- type AuthResult
- type AuthService
- func (this *AuthService) Auth(body []byte, allowedRoles []string) *rio.IO[*AuthResult]
- func (this *AuthService) AuthAdmin(body []byte) *rio.IO[*AuthResult]
- func (this *AuthService) AuthRoot(body []byte) *rio.IO[*AuthResult]
- func (this *AuthService) AuthRootOrAdmin(body []byte) *rio.IO[*AuthResult]
- func (this *AuthService) CheckBearerToken(bearerToken string) (*models.User, error)
- func (this *AuthService) GetUserRoles() []string
- func (this *AuthService) IsAdmin() bool
- func (this *AuthService) IsAuthenticated() bool
- func (this *AuthService) IsBearerToken(token string) bool
- func (this *AuthService) IsRoot() bool
- func (this *AuthService) SetUserInfo(user *models.User)
- func (this *AuthService) ValidPassword(password1 string, password2 string) error
- type AuthUser
- type LoginErrorTenantNotFound
- type LoginErrorUserInactive
- type LoginErrorUserNotFound
- type LoginErrorWrongPassword
- type LoginService
- func (this *LoginService) Authenticate(username string, password string) (*models.User, error)
- func (this *LoginService) AuthenticateToken(token string) (*models.User, error)
- func (this *LoginService) GetMessage(key string, args ...interface{}) string
- func (this *LoginService) Login(user *models.User, password string, byToken bool, err error) (*models.User, error)
- type MailService
- func (this *MailService) GenerateHash(body []byte) string
- func (this *MailService) GetDefaultEmail() map[string]string
- func (this *MailService) GetHtmlTemplate(templateName string) (string, error)
- func (this *MailService) OnTemplate(templateName string, values map[string]string) (string, error)
- func (this *MailService) PostEmail(email map[string]string) error
- func (this *MailService) ReplaceTemplate(templateContent string, values map[string]string) string
- func (this *MailService) Send(email *models.Email) error
- func (this *MailService) SendPasswordRecover(to string, name string, token string) error
- func (this *MailService) SendPasswordRecoverCode(to string, name string, code string) error
- func (this *MailService) SendPasswordRecoverWithUrl(to string, name string, url string) error
- type PushService
- func (this *PushService) Configure(data map[string]string)
- func (this *PushService) NotificateAll(message string) error
- func (this *PushService) NotificateByQuery(query string, message string) error
- func (this *PushService) NotificateByUserNameList(usernameList []string, message string) error
- func (this *PushService) NotificateUserName(username string, message string) error
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRootUser ¶
Types ¶
type AuditorService ¶
type AuditorService struct {
Lang string
AuditorInfo *AuditorInfo
Session *db.Session
}
func NewAuditorService ¶
func NewAuditorService(session *db.Session, lang string, info *AuditorInfo) *AuditorService
func (*AuditorService) OnAudit ¶
func (this *AuditorService) OnAudit(format string, v ...interface{})
func (*AuditorService) OnAuditWithNewDbSession ¶
func (this *AuditorService) OnAuditWithNewDbSession(format string, v ...interface{})
type AuthResult ¶
type AuthService ¶
func NewAuthService ¶
func NewAuthService(session *db.Session) *AuthService
func (*AuthService) Auth ¶
func (this *AuthService) Auth(body []byte, allowedRoles []string) *rio.IO[*AuthResult]
Auth by bearer token
func (*AuthService) AuthAdmin ¶
func (this *AuthService) AuthAdmin(body []byte) *rio.IO[*AuthResult]
func (*AuthService) AuthRoot ¶
func (this *AuthService) AuthRoot(body []byte) *rio.IO[*AuthResult]
func (*AuthService) AuthRootOrAdmin ¶
func (this *AuthService) AuthRootOrAdmin(body []byte) *rio.IO[*AuthResult]
func (*AuthService) CheckBearerToken ¶
func (this *AuthService) CheckBearerToken(bearerToken string) (*models.User, error)
func (*AuthService) GetUserRoles ¶
func (this *AuthService) GetUserRoles() []string
func (*AuthService) IsAdmin ¶
func (this *AuthService) IsAdmin() bool
func (*AuthService) IsAuthenticated ¶
func (this *AuthService) IsAuthenticated() bool
func (*AuthService) IsBearerToken ¶
func (this *AuthService) IsBearerToken(token string) bool
func (*AuthService) IsRoot ¶
func (this *AuthService) IsRoot() bool
func (*AuthService) SetUserInfo ¶
func (this *AuthService) SetUserInfo(user *models.User)
func (*AuthService) ValidPassword ¶
func (this *AuthService) ValidPassword(password1 string, password2 string) error
type LoginErrorTenantNotFound ¶
type LoginErrorTenantNotFound struct {
Message string
}
func LoginTenantNotFound ¶
func LoginTenantNotFound(msg string) *LoginErrorTenantNotFound
func (*LoginErrorTenantNotFound) Error ¶
func (e *LoginErrorTenantNotFound) Error() string
type LoginErrorUserInactive ¶
type LoginErrorUserInactive struct {
Message string
}
func LoginUserInactive ¶
func LoginUserInactive(msg string) *LoginErrorUserInactive
func (*LoginErrorUserInactive) Error ¶
func (e *LoginErrorUserInactive) Error() string
type LoginErrorUserNotFound ¶
type LoginErrorUserNotFound struct {
Message string
}
func LoginUserNotFound ¶
func LoginUserNotFound(msg string) *LoginErrorUserNotFound
func (*LoginErrorUserNotFound) Error ¶
func (e *LoginErrorUserNotFound) Error() string
type LoginErrorWrongPassword ¶
type LoginErrorWrongPassword struct {
Message string
}
func LoginWrongPassword ¶
func LoginWrongPassword(msg string) *LoginErrorWrongPassword
func (*LoginErrorWrongPassword) Error ¶
func (e *LoginErrorWrongPassword) Error() string
type LoginService ¶
type LoginService struct {
Lang string
Session *db.Session
ModelUser *models.User
ModelTenantUser *models.TenantUser
}
func NewLoginService ¶
func NewLoginService(lang string, session *db.Session) *LoginService
func (*LoginService) Authenticate ¶
func (*LoginService) AuthenticateToken ¶
func (this *LoginService) AuthenticateToken(token string) (*models.User, error)
func (*LoginService) GetMessage ¶
func (this *LoginService) GetMessage(key string, args ...interface{}) string
type MailService ¶
type MailService struct {
Controller beego.Controller
PasswordRecoverTemplateName string
ApiKey string
ApiAppName string
AppName string
AppUrl string
EmailDefault string
EmailPasswordDefault string
MailServerUrl string
}
func NewMailService ¶
func NewMailService(data map[string]string) *MailService
func (*MailService) GenerateHash ¶
func (this *MailService) GenerateHash(body []byte) string
func (*MailService) GetDefaultEmail ¶
func (this *MailService) GetDefaultEmail() map[string]string
func (*MailService) GetHtmlTemplate ¶
func (this *MailService) GetHtmlTemplate(templateName string) (string, error)
func (*MailService) OnTemplate ¶
func (*MailService) ReplaceTemplate ¶
func (this *MailService) ReplaceTemplate(templateContent string, values map[string]string) string
func (*MailService) SendPasswordRecover ¶
func (this *MailService) SendPasswordRecover(to string, name string, token string) error
func (*MailService) SendPasswordRecoverCode ¶
func (this *MailService) SendPasswordRecoverCode(to string, name string, code string) error
func (*MailService) SendPasswordRecoverWithUrl ¶
func (this *MailService) SendPasswordRecoverWithUrl(to string, name string, url string) error
type PushService ¶
func NewPushService ¶
func NewPushService(session *db.Session) *PushService
func (*PushService) Configure ¶
func (this *PushService) Configure(data map[string]string)
func (*PushService) NotificateAll ¶
func (this *PushService) NotificateAll(message string) error
func (*PushService) NotificateByQuery ¶
func (this *PushService) NotificateByQuery(query string, message string) error
query should return a username list
func (*PushService) NotificateByUserNameList ¶
func (this *PushService) NotificateByUserNameList(usernameList []string, message string) error
func (*PushService) NotificateUserName ¶
func (this *PushService) NotificateUserName(username string, message string) error
Click to show internal directories.
Click to hide internal directories.