middleware

package
v0.0.0-...-30b40a1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(oa AuthOAuth) func(http.Handler) http.Handler

func CORS

func CORS(fn func(opt *CORSOption)) func(http.Handler) http.Handler

func CORSProcess

func CORSProcess(next http.Handler) http.Handler

func Logger

func Logger(log logger.Logger) func(http.Handler) http.Handler

Types

type AuthOAuth

type AuthOAuth interface {
	ContextAccessToken(ctx context.Context, token string) context.Context
}

type CORSOption

type CORSOption struct {
	AllowedOrigin, AllowedMethod, AllowedHeader []string
	ExposedHeader                               []string
	AllowCredentials                            bool
	SkipOrigin                                  bool
	MaxAge                                      int
}

Jump to

Keyboard shortcuts

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