utils

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func ExtractBearerToken(authHeader string) string

ExtractBearerToken extracts the token from the Authorization header. The header should be in the format: "Bearer <token>".

func GetClientIP

func GetClientIP(r *http.Request) string

func IsValidRedirectURI

func IsValidRedirectURI(uri string) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL