middler

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 15 Imported by: 2

Documentation

Overview

Package middler is a middleware package for kratos.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowListMatcher

func AllowListMatcher(list ...string) selector.MatchFunc

AllowListMatcher new allow operation list matcher

func Cors

func Cors(c *CorsConfig) func(http.Handler) http.Handler

Cors Cross-domain middleware

func Validate

Validate validate request parameters

Types

type CorsConfig

type CorsConfig struct {
	AllowOrigins    []string
	AllowHeaders    []string
	AllowMethods    []string
	ExposeHeaders   []string
	MaxAge          int
	AllowOriginFunc func(origin string) bool
}

type ValidateHandler

type ValidateHandler func(ctx context.Context, req interface{}) error

ValidateHandler validate handler

Jump to

Keyboard shortcuts

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