Documentation
¶
Index ¶
- func DummyRoute(w http.ResponseWriter, r *http.Request)
- func ErrorResponse(w http.ResponseWriter, message string, statusCode int, errorCodes ...int)
- func ExtractBearerToken(authHeader string) string
- func GetClientIP(r *http.Request) string
- func HashSHA256(s string) string
- func IsValidRedirectURI(uri string) bool
- func Ptr[T any](v T) *T
- func SuccessResponse[T any](w http.ResponseWriter, data T, statusCodes ...int)
- func WriteApiResponse(w http.ResponseWriter, data any, statusCode int)
- func WriteErrorResponse(w http.ResponseWriter, statusCode int, errorType, errorDescription string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DummyRoute ¶
func DummyRoute(w http.ResponseWriter, r *http.Request)
func ErrorResponse ¶
func ErrorResponse(w http.ResponseWriter, message string, statusCode int, errorCodes ...int)
func ExtractBearerToken ¶
ExtractBearerToken extracts the token from the Authorization header. The header should be in the format: "Bearer <token>".
func GetClientIP ¶
func HashSHA256 ¶ added in v1.0.0
func IsValidRedirectURI ¶
IsValidRedirectURI checks that the given URI is a syntactically valid URL with a scheme and host. Per-client redirect URI allowlist validation is handled separately at the client level.
func SuccessResponse ¶
func SuccessResponse[T any](w http.ResponseWriter, data T, statusCodes ...int)
func WriteApiResponse ¶
func WriteApiResponse(w http.ResponseWriter, data any, statusCode int)
func WriteErrorResponse ¶
func WriteErrorResponse(w http.ResponseWriter, statusCode int, errorType, errorDescription string)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.