Documentation
¶
Index ¶
- Constants
- func ApiWithBaseUrl(preUrl, url string) string
- func GenerateToken(username string) (string, error)
- func GetToken(r *http.Request) string
- func GetTokenByHeader(header http.Header) string
- func GetTokenGame(r *http.Request) string
- func GetTokenGameByHeader(header http.Header) string
- func HttpErrorResponse(w http.ResponseWriter, message string, code int)
- func HttpOkResponse[T any](w http.ResponseWriter, res T)
- func ValidToken(tokenString string) error
- type ReqBase
- type ResBase
Constants ¶
View Source
const ( TokenName = "Token" // the name "Token" be used many places, so use the name "TokenName" TokenGame = "TokenGame" Authorization = "Authorization" AuthorizationGame = "AuthorizationGame" )
Variables ¶
This section is empty.
Functions ¶
func ApiWithBaseUrl ¶
func GenerateToken ¶
func GetTokenByHeader ¶
func GetTokenGame ¶
func GetTokenGameByHeader ¶
func HttpErrorResponse ¶
func HttpErrorResponse(w http.ResponseWriter, message string, code int)
func HttpOkResponse ¶
func HttpOkResponse[T any](w http.ResponseWriter, res T)
func ValidToken ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.