Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORSMiddleware ¶
func CORSMiddleware(options CORSOptions) func(http.Handler) http.Handler
CORSMiddleware creates a new CORS middleware with the given options
Types ¶
type AuthMiddleware ¶
type AuthMiddleware interface {
RefreshToken(w http.ResponseWriter, req *http.Request)
Verify(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
}
type CORSOptions ¶
type CORSOptions struct {
AllowedOrigins []string // List of allowed origins
AllowedMethods []string // List of allowed methods (e.g., GET, POST)
AllowedHeaders []string // List of allowed headers
AllowCredentials bool // Whether to allow credentials (cookies, authorization headers)
}
CORSOptions defines the settings for CORS configuration
type JsonWebTokenMiddleware ¶
type JsonWebTokenMiddleware interface {
CreateSession(w http.ResponseWriter, r *http.Request) (service.Session, error)
GenerateToken(w http.ResponseWriter, req *http.Request)
AuthMiddleware
}
Click to show internal directories.
Click to hide internal directories.