Documentation ¶
Index ¶
- func CheckError(err error)
- func CheckPassword(password string, hash string) bool
- func CreateToken(claims map[string]interface{}) (string, error)
- func DeviceConnectMiddleware(w http.ResponseWriter, r *http.Request, accountID string) string
- func GeneratePassword(size int) string
- func GetCurrentUserDevice(w http.ResponseWriter, req *http.Request, accountID string) model.DeviceConnect
- func GetDeviceName(ip string) (string, error)
- func GetDeviceNameWithIp(w http.ResponseWriter, r *http.Request) string
- func GetIPAddress(r *http.Request) string
- func HashPassword(password string) string
- func NewTokenAuth() *jwtauth.JWTAuth
- func VerifyToken(tokenString string) bool
- func WriteError(w http.ResponseWriter, statusCode int, message string)
- type DeviceInfo
- type DeviceInfoResponse
- type ErrorResponse
- type IPInfoResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckError ¶ added in v2.1.1
func CheckError(err error)
func CheckPassword ¶
func CreateToken ¶
func DeviceConnectMiddleware ¶ added in v2.1.1
func GeneratePassword ¶
func GetCurrentUserDevice ¶ added in v2.1.2
func GetCurrentUserDevice(w http.ResponseWriter, req *http.Request, accountID string) model.DeviceConnect
func GetDeviceName ¶ added in v2.1.1
func GetDeviceNameWithIp ¶ added in v2.1.1
func GetDeviceNameWithIp(w http.ResponseWriter, r *http.Request) string
func GetIPAddress ¶ added in v2.1.1
func HashPassword ¶
func NewTokenAuth ¶
func NewTokenAuth() *jwtauth.JWTAuth
func VerifyToken ¶
func WriteError ¶ added in v2.1.1
func WriteError(w http.ResponseWriter, statusCode int, message string)
Types ¶
type DeviceInfo ¶ added in v2.1.1
type DeviceInfoResponse ¶ added in v2.3.1
type DeviceInfoResponse struct { Os string `json:"os"` Browser string `json:"browser"` Location string `json:"location"` }
func GetDeviceInfo ¶ added in v2.3.1
func GetDeviceInfo(req *http.Request) DeviceInfoResponse
type ErrorResponse ¶ added in v2.1.1
type ErrorResponse struct {
Message string `json:"message"`
}
type IPInfoResponse ¶ added in v2.1.1
Click to show internal directories.
Click to hide internal directories.