middlewareutil

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 2

README

中间件

Documentation

Index

Constants

View Source
const (
	TransportServiceKindALL           = "ALL"
	TransportServiceKindHTTP          = "HTTP"
	TransportServiceKindGRPC          = "GRPC"
	TransportServiceKindMethodGet     = "GET"
	TransportServiceKindMethodHead    = "HEAD"
	TransportServiceKindMethodPost    = "POST"
	TransportServiceKindMethodPut     = "PUT"
	TransportServiceKindMethodPatch   = "PATCH"
	TransportServiceKindMethodDelete  = "DELETE"
	TransportServiceKindMethodConnect = "CONNECT"
	TransportServiceKindMethodOptions = "OPTIONS"
	TransportServiceKindMethodTrace   = "TRACE"
)

Variables

This section is empty.

Functions

func DefaultClientMiddlewares

func DefaultClientMiddlewares(logHelper *log.Helper) []middleware.Middleware

DefaultClientMiddlewares 中间件

func DefaultServerMiddlewares

func DefaultServerMiddlewares(logHelper *log.Helper) []middleware.Middleware

DefaultServerMiddlewares 中间件

func MergeWhitelist

func MergeWhitelist(whitelist ...map[string]TransportServiceKind) map[string]TransportServiceKind

func NewAuthMiddleware

func NewAuthMiddleware(authTokenRepo authpkg.AuthRepo, whiteList map[string]TransportServiceKind) (m middleware.Middleware, err error)

NewAuthMiddleware 验证中间

func NewWhiteListMatcher

func NewWhiteListMatcher(whiteList map[string]TransportServiceKind) selector.MatchFunc

NewWhiteListMatcher 路由白名单

Types

type TransportServiceKind

type TransportServiceKind string

TransportServiceKind 通行类型

func (TransportServiceKind) MatchServiceKind

func (s TransportServiceKind) MatchServiceKind(ctx context.Context) bool

Jump to

Keyboard shortcuts

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