middleware

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MappingBuilder

type MappingBuilder struct {
	// contains filtered or unexported fields
}

MappingBuilder builds web.MiddlewareMapping Either MappingBuilder.Use or MappingBuilder.With should be set in order to successfully build a mapping. If MappingBuilder.ApplyTo is not set, the middleware intercept all routes. Supported handler function are gin.HandlerFunc or http.HandlerFunc Example: <code> middleware.NewBuilder("my-auth").Order(-10).ApplyTo(matcher.RequestWithPattern("/api/v1/**")).Use(func...).Build() </code>

func NewBuilder

func NewBuilder(names ...string) *MappingBuilder

func (*MappingBuilder) ApplyTo

func (b *MappingBuilder) ApplyTo(matcher web.RouteMatcher) *MappingBuilder

func (*MappingBuilder) Build

func (*MappingBuilder) GetCondition

func (b *MappingBuilder) GetCondition() web.RequestMatcher

func (*MappingBuilder) GetName

func (b *MappingBuilder) GetName() string

func (*MappingBuilder) GetOrder

func (b *MappingBuilder) GetOrder() int

func (*MappingBuilder) GetRouteMatcher

func (b *MappingBuilder) GetRouteMatcher() web.RouteMatcher

func (*MappingBuilder) Name

func (b *MappingBuilder) Name(name string) *MappingBuilder

func (*MappingBuilder) Order

func (b *MappingBuilder) Order(order int) *MappingBuilder

func (*MappingBuilder) Use

func (b *MappingBuilder) Use(handlerFunc interface{}) *MappingBuilder

Use set middleware handler. Support: - gin.HandlerFunc - http.HandlerFunc

func (*MappingBuilder) With

func (b *MappingBuilder) With(middleware web.Middleware) *MappingBuilder

func (*MappingBuilder) WithCondition

func (b *MappingBuilder) WithCondition(condition web.RequestMatcher) *MappingBuilder

Jump to

Keyboard shortcuts

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