Documentation
¶
Index ¶
- Constants
- func AuthenticateUserForLogin(id, loginId, password string) (*model.User, *model.AppError)
- func AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, ...) (string, io.ReadCloser, *model.AppError)
- func CheckIfRolesGrantPermission(roles []string, permissionId string) bool
- func CheckPasswordAndAllCriteria(user *model.User, password string) *model.AppError
- func CheckUserAdditionalAuthenticationCriteria(user *model.User) *model.AppError
- func CloseBody(r *http.Response)
- func CompleteOAuth(service string, userData io.ReadCloser) (bool, *model.User, *model.AppError)
- func CompleteOAuthMobile(service string, userData io.ReadCloser, props map[string]string) (*model.User, *model.AppError)
- func CreateOAuthMobileUser(service string, userData io.Reader) (*model.User, *model.AppError)
- func CreateOAuthStateToken(extra string, props model.StringInterface) (*model.Token, *model.AppError)
- func CreateOAuthUser(service string, userData io.Reader) (bool, *model.User, *model.AppError)
- func CreateProfileImage(username string, userId string) ([]byte, *model.AppError)
- func CreateUser(user *model.User) (*model.User, *model.AppError)
- func CreateUserFromEmailOrMobile(user *model.User) (*model.User, *model.AppError)
- func CreateVerifyCodeToken(mobile, verifiedCode string) (*model.Token, *model.AppError)
- func CustomClaimsHasPermissionTo(customClaims model.CustomClaims, permission *model.Permission) bool
- func DeleteToken(token *model.Token) *model.AppError
- func DoLogin(w http.ResponseWriter, r *http.Request, user *model.User, deviceId string) *model.AppError
- func GetAuthorizationCode(w http.ResponseWriter, r *http.Request, service string, ...) (string, *model.AppError)
- func GetMd5String(s string) string
- func GetOAuthLoginEndpoint(w http.ResponseWriter, r *http.Request, service, action string) (string, *model.AppError)
- func GetOAuthStateToken(token string) (*model.Token, *model.AppError)
- func GetProfileImage(user *model.User) ([]byte, bool, *model.AppError)
- func GetProtocol(r *http.Request) string
- func GetTokenByExtra(extra string) (*model.Token, *model.AppError)
- func GetTokenCountByExtra(extra string) (int64, *model.AppError)
- func GetUser(userId string) (*model.User, *model.AppError)
- func GetUserByAuth(authData *string, authService string) (*model.User, *model.AppError)
- func GetUserByEmail(email string) (*model.User, *model.AppError)
- func GetUserByMobile(mobile string) (*model.User, *model.AppError)
- func GetUserByUsername(username string) (*model.User, *model.AppError)
- func GetUserForLogin(loginId string) (*model.User, *model.AppError)
- func InitStores()
- func IsDoctor(userId string) bool
- func IsEmailExist(email string) bool
- func IsFirstUserAccount() bool
- func IsMobileExist(mobile string) bool
- func IsUserSignUpAllowed() *model.AppError
- func IsUsernameTaken(name string) bool
- func NewServer()
- func ReadFile(path string) ([]byte, *model.AppError)
- func ReloadConfig()
- func SanitizeProfile(user *model.User, asAdmin bool)
- func SearchUsers(props *model.UserSearch, searchOptions map[string]bool, asAdmin bool) ([]*model.User, *model.AppError)
- func SendEmailVerificationCode(email string) *model.AppError
- func SendSmsCode(mobile string, w http.ResponseWriter, r *http.Request) *model.AppError
- func SendVerificationCodeToEmail(userEmail, locale, siteURL, verifiedCode string) *model.AppError
- func SetCookieAndToken(w http.ResponseWriter, r *http.Request, user *model.User) (string, *model.AppError)
- func SetOAuthProfileImage(user *model.User) *model.AppError
- func SetProfileImage(w http.ResponseWriter, userId string, imageData *multipart.FileHeader) *model.AppError
- func SignupWithOauth(w http.ResponseWriter, r *http.Request, ...) (*model.User, *model.AppError)
- func StartServer()
- func StopServer()
- func UpdatePassword(user *model.User, newPassword string) *model.AppError
- func ValidateTokenMiddleware(w http.ResponseWriter, r *http.Request) (interface{}, error)
- func VerifiedCode(r *http.Request, email, mobile, verificationCode string) *model.AppError
- type ALiYunSmsClient
- type CorsWrapper
- type RecoveryLogger
- type Server
- type VaryBy
Constants ¶
View Source
const ( /* EXIF Image Orientations 1 2 3 4 5 6 7 8 888888 888888 88 88 8888888888 88 88 8888888888 88 88 88 88 88 88 88 88 88 88 88 88 8888 8888 8888 8888 88 8888888888 8888888888 88 88 88 88 88 88 88 888888 888888 */ Upright = 1 UprightMirrored = 2 UpsideDown = 3 UpsideDownMirrored = 4 RotatedCWMirrored = 5 RotatedCCW = 6 RotatedCCWMirrored = 7 RotatedCW = 8 MaxImageSize = 6048 * 4032 // 24 megapixels, roughly 36MB as a raw image IMAGE_THUMBNAIL_PIXEL_WIDTH = 120 IMAGE_THUMBNAIL_PIXEL_HEIGHT = 100 IMAGE_PREVIEW_PIXEL_WIDTH = 1024 )
View Source
const ( OAUTH_COOKIE_MAX_AGE_SECONDS = 30 * 60 // 30 minutes COOKIE_OAUTH = "MMOAUTH" )
View Source
const ( TOKEN_TYPE_PASSWORD_RECOVERY = "password_recovery" TOKEN_TYPE_VERIFY_EMAIL = "verify_email" TOKEN_TYPE_VERIFY_MOBILE = "verify_mobile" PASSWORD_RECOVER_EXPIRY_TIME = 1000 * 60 * 60 // 1 hour VERIFY_EMAIL_EXPIRY_TIME = 1000 * 60 * 60 // 1 hour IMAGE_PROFILE_PIXEL_DIMENSION = 128 SMS_COOKIE_MAX_AGE_SECONDS = 30 * 60 // 30 minutes VERIFICATION_CODE = "verified_code" COOKIE_SMS_TOKEN = "verified_token" )
View Source
const TIME_TO_WAIT_FOR_CONNECTIONS_TO_CLOSE_ON_SERVER_SHUTDOWN = time.Second
Variables ¶
This section is empty.
Functions ¶
func AuthenticateUserForLogin ¶
func AuthenticateUserForLogin(id, loginId, password string) (*model.User, *model.AppError)
func AuthorizeOAuthUser ¶
func AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service, code, state, redirectUri string) (string, io.ReadCloser, *model.AppError)
func CompleteOAuth ¶
func CompleteOAuthMobile ¶
func CreateOAuthMobileUser ¶
func CreateOAuthStateToken ¶
func CreateOAuthUser ¶
func CreateProfileImage ¶
func CreateVerifyCodeToken ¶
func CustomClaimsHasPermissionTo ¶
func CustomClaimsHasPermissionTo(customClaims model.CustomClaims, permission *model.Permission) bool
func DoLogin ¶
func DoLogin(w http.ResponseWriter, r *http.Request, user *model.User, deviceId string) *model.AppError
func GetAuthorizationCode ¶
func GetMd5String ¶
func GetOAuthLoginEndpoint ¶
func GetProtocol ¶
func GetUserByAuth ¶
func InitStores ¶
func InitStores()
func IsEmailExist ¶
func IsFirstUserAccount ¶
func IsFirstUserAccount() bool
func IsMobileExist ¶
func IsUserSignUpAllowed ¶
func IsUsernameTaken ¶
func ReloadConfig ¶
func ReloadConfig()
func SanitizeProfile ¶
func SearchUsers ¶
func SendSmsCode ¶
func SetCookieAndToken ¶
func SetProfileImage ¶
func SetProfileImage(w http.ResponseWriter, userId string, imageData *multipart.FileHeader) *model.AppError
func SignupWithOauth ¶
func StartServer ¶
func StartServer()
func StopServer ¶
func StopServer()
func ValidateTokenMiddleware ¶
func ValidateTokenMiddleware(w http.ResponseWriter, r *http.Request) (interface{}, error)
Types ¶
type ALiYunSmsClient ¶
type ALiYunSmsClient struct { Request *model.ALiYunCommunicationRequest GatewayUrl string Client *http.Client }
func NewALiYunSmsClient ¶
func NewALiYunSmsClient(gatewayUrl string) *ALiYunSmsClient
func (*ALiYunSmsClient) Execute ¶
func (smsClient *ALiYunSmsClient) Execute(accessKeyId, accessKeySecret, mobile, signName, templateCode, templateParam string) (err error)
type CorsWrapper ¶
type CorsWrapper struct {
// contains filtered or unexported fields
}
func (*CorsWrapper) ServeHTTP ¶
func (cw *CorsWrapper) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RecoveryLogger ¶
type RecoveryLogger struct { }
func (*RecoveryLogger) Println ¶
func (rl *RecoveryLogger) Println(i ...interface{})
Click to show internal directories.
Click to hide internal directories.