middleware

package
v0.0.6-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

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
}

Jump to

Keyboard shortcuts

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