MCPcopy Create free account
hub / github.com/kataras/iris / UseOnce

Method UseOnce

core/router/api_builder.go:1316–1318  ·  view source on GitHub ↗

UseOnce either inserts a middleware, or on the basis of the middleware already existing, replace that existing middleware instead. To register a middleware for error handlers, look `UseError` method instead.

(handlers ...context.Handler)

Source from the content-addressed store, hash-verified

1314// replace that existing middleware instead.
1315// To register a middleware for error handlers, look `UseError` method instead.
1316func (api *APIBuilder) UseOnce(handlers ...context.Handler) {
1317 api.middleware = context.UpsertHandlers(api.middleware, handlers)
1318}
1319
1320// UseGlobal registers handlers that should run at the very beginning.
1321// It prepends those handler(s) to all routes,

Callers

nothing calls this directly

Calls 1

UpsertHandlersFunction · 0.92

Tested by

no test coverage detected