middleware

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TAG_URL             = "url"
	TAG_OPT_EXPAND_ENV  = "@ExpandEnv"
	TAG_OPT_BIND_METHOD = "@BindMethod"

	NoopLoggingServiceSingleton = NoopLoggingService{}
	NoopEventLogSingleton       = NoopEventLog(0)
)

Functions

func UrlTagResolver

func UrlTagResolver(fieldname, token string) (*structproto.Tag, error)

Types

type CompositeEventLog

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

func (CompositeEventLog) Flush

func (l CompositeEventLog) Flush()

Flush implements EventLog.

func (CompositeEventLog) OnError

func (l CompositeEventLog) OnError(ctx *fasthttp.RequestCtx, err interface{}, stackTrace []byte)

OnError implements EventLog.

func (CompositeEventLog) OnProcessRequest

func (l CompositeEventLog) OnProcessRequest(ctx *fasthttp.RequestCtx)

OnProcessRequest implements EventLog.

func (CompositeEventLog) OnProcessRequestComplete

func (l CompositeEventLog) OnProcessRequestComplete(ctx *fasthttp.RequestCtx, flag responseutil.ResponseFlag)

OnProcessRequestComplete implements EventLog.

type CompositeLoggingService

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

func NewCompositeLoggingService

func NewCompositeLoggingService(services ...LoggingService) *CompositeLoggingService

func (*CompositeLoggingService) ConfigureLogger

func (s *CompositeLoggingService) ConfigureLogger(l *log.Logger)

ConfigureLogger implements LoggingService.

func (*CompositeLoggingService) CreateEventLog

func (s *CompositeLoggingService) CreateEventLog(ev EventEvidence) EventLog

CreateEventLog implements LoggingService.

type ErrorHandlerMiddleware

type ErrorHandlerMiddleware struct {
	Handler ErrorHandler
}

func (*ErrorHandlerMiddleware) Init

func (m *ErrorHandlerMiddleware) Init(app *host.AppModule)

Init implements internal.Middleware

type EventEvidence

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

func (EventEvidence) RequestRoutePath

func (e EventEvidence) RequestRoutePath() internal.RoutePath

func (EventEvidence) RequestSpanID

func (e EventEvidence) RequestSpanID() trace.SpanID

func (EventEvidence) RequestTraceID

func (e EventEvidence) RequestTraceID() trace.TraceID

type EventLog

type EventLog interface {
	OnError(ctx *internal.RequestCtx, err interface{}, stackTrace []byte)
	OnProcessRequest(ctx *internal.RequestCtx)
	OnProcessRequestComplete(ctx *internal.RequestCtx, flag response.ResponseFlag)
	Flush()
}

type LoggingHandleModule

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

func (*LoggingHandleModule) CanSetSuccessor

func (*LoggingHandleModule) CanSetSuccessor() bool

CanSetSuccessor implements RequestHandleModule

func (*LoggingHandleModule) OnInitComplete

func (*LoggingHandleModule) OnInitComplete()

OnInitComplete implements RequestHandleModule

func (*LoggingHandleModule) OnStart

func (*LoggingHandleModule) OnStart(ctx context.Context) error

OnStart implements RequestHandleModule

func (*LoggingHandleModule) OnStop

OnStop implements RequestHandleModule

func (*LoggingHandleModule) ProcessRequest

func (m *LoggingHandleModule) ProcessRequest(ctx *RequestCtx, state RequestState, recover *Recover)

ProcessRequest implements RequestHandleModule

func (*LoggingHandleModule) SetSuccessor

func (m *LoggingHandleModule) SetSuccessor(successor RequestHandleModule)

SetSuccessor implements RequestHandleModule

type LoggingMiddleware

type LoggingMiddleware struct {
	LoggingService LoggingService
}

func (*LoggingMiddleware) Init

func (m *LoggingMiddleware) Init(app *host.AppModule)

Init implements internal.Middleware

type LoggingService

type LoggingService interface {
	CreateEventLog(ev EventEvidence) EventLog
	ConfigureLogger(l *log.Logger)
}

type NoopEventLog

type NoopEventLog int

func (NoopEventLog) Flush

func (NoopEventLog) Flush()

Flush implements EventLog.

func (NoopEventLog) OnError

func (NoopEventLog) OnError(ctx *fasthttp.RequestCtx, err interface{}, stackTrace []byte)

OnError implements EventLog.

func (NoopEventLog) OnProcessRequest

func (NoopEventLog) OnProcessRequest(ctx *fasthttp.RequestCtx)

OnProcessRequest implements EventLog.

func (NoopEventLog) OnProcessRequestComplete

func (NoopEventLog) OnProcessRequestComplete(ctx *fasthttp.RequestCtx, flag responseutil.ResponseFlag)

OnProcessRequestComplete implements EventLog.

type NoopLoggingService

type NoopLoggingService struct{}

func (NoopLoggingService) ConfigureLogger

func (NoopLoggingService) ConfigureLogger(*log.Logger)

ConfigureLogger implements LoggingService.

func (NoopLoggingService) CreateEventLog

func (NoopLoggingService) CreateEventLog(EventEvidence) EventLog

CreateEventLog implements LoggingService.

type RequestHandlerBinder

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

func (*RequestHandlerBinder) Bind

func (*RequestHandlerBinder) Deinit

func (*RequestHandlerBinder) Init

type RequestManagerBinder

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

func (*RequestManagerBinder) Bind

func (*RequestManagerBinder) Deinit

func (*RequestManagerBinder) Init

type RequestManagerMiddleware

type RequestManagerMiddleware struct {
	RequestManager interface{}
}

func (*RequestManagerMiddleware) Init

func (m *RequestManagerMiddleware) Init(app *host.AppModule)

Init implements internal.Middleware

type RewriterMiddleware

type RewriterMiddleware struct {
	Handler RewriteHandler
}

func (*RewriterMiddleware) Init

func (m *RewriterMiddleware) Init(app *host.AppModule)

Init implements internal.Middleware

type TracingMiddleware

type TracingMiddleware struct {
	Enabled bool
}

func (*TracingMiddleware) Init

func (m *TracingMiddleware) Init(app *host.AppModule)

Init implements internal.Middleware

type UnhandledRequestHandlerMiddleware

type UnhandledRequestHandlerMiddleware struct {
	Handler RequestHandler
}

func (*UnhandledRequestHandlerMiddleware) Init

type XHttpMethodHeaderMiddleware

type XHttpMethodHeaderMiddleware struct {
	Headers []string
}

func (*XHttpMethodHeaderMiddleware) Init

Init implements internal.Middleware

type XHttpMethodHeaderRouteResolveModule

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

func (*XHttpMethodHeaderRouteResolveModule) CanSetSuccessor

func (m *XHttpMethodHeaderRouteResolveModule) CanSetSuccessor() bool

func (*XHttpMethodHeaderRouteResolveModule) ResolveHttpMethod

func (m *XHttpMethodHeaderRouteResolveModule) ResolveHttpMethod(ctx *RequestCtx) string

func (*XHttpMethodHeaderRouteResolveModule) ResolveHttpPath

func (m *XHttpMethodHeaderRouteResolveModule) ResolveHttpPath(ctx *RequestCtx) string

func (*XHttpMethodHeaderRouteResolveModule) SetSuccessor

func (m *XHttpMethodHeaderRouteResolveModule) SetSuccessor(successor RouteResolver)

Jump to

Keyboard shortcuts

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