Documentation ¶
Index ¶
- Constants
- func DefaultClientMiddlewares(logHelper *log.Helper) []middleware.Middleware
- func DefaultServerMiddlewares(logHelper *log.Helper) []middleware.Middleware
- func MergeWhitelist(whitelist ...map[string]TransportServiceKind) map[string]TransportServiceKind
- func NewAuthMiddleware(authTokenRepo authpkg.AuthRepo, whiteList map[string]TransportServiceKind) (m middleware.Middleware, err error)
- func NewWhiteListMatcher(whiteList map[string]TransportServiceKind) selector.MatchFunc
- type TransportServiceKind
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
Click to show internal directories.
Click to hide internal directories.