Documentation ¶
Index ¶
- Variables
- func Error(w http.ResponseWriter, statusCode int, message string)
- func GoogleGetUserInfo(code string) (models.User, error)
- func HashPassword(password string) (string, error)
- func IsEmailValid(e string) bool
- func LogErrors(errorLogFile string)
- func Mail(email *mail.Email)
- func RandToken() string
- func SendRegisterMail(data map[string]any, to ...string) *mail.Email
- func Success(w http.ResponseWriter, data any)
- type JwtStruct
Constants ¶
This section is empty.
Variables ¶
View Source
var GoogleConf = &oauth2.Config{ ClientID: config.GoogleClientID, ClientSecret: config.GoogleClientSecret, RedirectURL: config.ServerURL + "/google-user/login", Scopes: []string{ "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile", }, Endpoint: google.Endpoint, }
View Source
var GoogleLoginURL = GoogleConf.AuthCodeURL(LoginState)
View Source
var GoogleRegisterURL = GoogleConf.AuthCodeURL(RegisterState)
View Source
var LoginState = RandToken()
View Source
var RegisterState = RandToken()
Functions ¶
func HashPassword ¶
func IsEmailValid ¶
func LogErrors ¶
func LogErrors(errorLogFile string)
This function is set a log file All errors will be store in errorLogFile
func Success ¶
func Success(w http.ResponseWriter, data any)
Types ¶
Click to show internal directories.
Click to hide internal directories.