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

Struct APIBuilder

core/router/api_builder.go:213–286  ·  view source on GitHub ↗

APIBuilder the visible API for constructing the router and child routers.

Source from the content-addressed store, hash-verified

211// APIBuilder the visible API for constructing the router
212// and child routers.
213type APIBuilder struct {
214 // the application logger.
215 logger *golog.Logger
216 // parent is the creator of this Party.
217 // It is nil on Root.
218 parent *APIBuilder // currently it's not used anywhere.
219
220 // the per-party APIBuilder with DI.
221 apiBuilderDI *APIContainer
222
223 // the api builder global macros registry
224 macros *macro.Macros
225 // the per-party (and its children) values map
226 // that may help on building the API
227 // when source code is splitted between projects.
228 // Initialized on Properties method.
229 properties context.Map
230 // the api builder global routes repository
231 routes *repository
232 // disables the debug logging of routes under a per-party and its children.
233 routesNoLog bool
234
235 // the per-party handlers, order
236 // of handlers registration matters,
237 // inherited by children unless Reset is called.
238 middleware context.Handlers
239 middlewareErrorCode context.Handlers
240 // the global middleware handlers, order of call doesn't matters, order
241 // of handlers registration matters. We need a secondary field for this
242 // because `UseGlobal` registers handlers that should be executed
243 // even before the `middleware` handlers, and in the same time keep the order
244 // of handlers registration, so the same type of handlers are being called in order.
245 beginGlobalHandlers context.Handlers
246
247 // the per-party done handlers, order matters.
248 doneHandlers context.Handlers
249 // global done handlers, order doesn't matter.
250 doneGlobalHandlers context.Handlers
251
252 // the per-party relative path.
253 relativePath string
254 // allowMethods are filled with the `AllowMethods` method.
255 // They are used to create new routes
256 // per any party's (and its children) routes registered
257 // if the method "x" wasn't registered already via the `Handle` (and its extensions like `Get`, `Post`...).
258 allowMethods []string
259
260 // the per-party (and its children) execution rules for begin, main and done handlers.
261 handlerExecutionRules ExecutionRules
262 // the per-party (and its children) route registration rule, see `SetRegisterRule`.
263 routeRegisterRule RouteRegisterRule
264
265 // routerFilterHandlers holds a reference
266 // of the handlers used by the current and its parent Party's registered
267 // router filters. Inherited by children unless `Reset` (see `UseRouter`),
268 routerFilterHandlers context.Handlers
269 // routerFilters field is shared across Parties. Each Party registers
270 // one or more middlewares to run before the router itself using the `UseRouter` method.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected