QRouter
@quik/http / QRouter
Class: QRouter
Defined in: http/src/router/QRouter.ts:11
Router used to register and manage application routes.
Extends
QObject
Constructors
Constructor
new QRouter():
QRouter
Returns
QRouter
Inherited from
QObject.constructor
Properties
_routes
protected_routes:QRoute[] =[]
Defined in: http/src/router/QRouter.ts:12
Accessors
logger
Get Signature
get
protectedlogger():IQLogger
Defined in: core/src/QObject.ts:15
The logger getter for the object.
Returns
IQLogger
Inherited from
QObject.logger
name
Get Signature
get name():
string
Defined in: core/src/QObject.ts:8
Returns
string
Inherited from
QObject.name
routes
Get Signature
get routes():
QRoute[]
Defined in: http/src/router/QRouter.ts:14
Returns
QRoute[]
Methods
_registerRoute()
protected_registerRoute(route):void
Defined in: http/src/router/QRouter.ts:41
Internal helper used to normalize and store a route.
Parameters
route
Route instance or constructor.
Returns
void
clear()
clear():
void
Defined in: http/src/router/QRouter.ts:21
Remove all registered routes.
Returns
void
endSpan()
protectedendSpan(span):void
Defined in: core/src/QObject.ts:35
End a span returned by startSpan.
Parameters
span
TelemetrySpan
The span to end.
Returns
void
Inherited from
QObject.endSpan
recordSpanError()
protectedrecordSpanError(span,err):void
Defined in: core/src/QObject.ts:45
Record an exception on an active span.
Parameters
span
TelemetrySpan
The span to record the error on.
err
unknown
The error to record.
Returns
void
Inherited from
QObject.recordSpanError
register()
register(...
routes):void
Defined in: http/src/router/QRouter.ts:30
Register one or more routes on the router instance.
Parameters
routes
...(QRoute | Constructor<QRoute>)[]
Routes or constructors to register.
Returns
void
setSpanAttribute()
protectedsetSpanAttribute(span,key,value):void
Defined in: core/src/QObject.ts:64
Set a single attribute on an active span.
Parameters
span
TelemetrySpan
The span to update.
key
string
Attribute key.
value
string | number | boolean
Attribute value.
Returns
void
Inherited from
QObject.setSpanAttribute
startSpan()
protectedstartSpan(spanName,options?):TelemetrySpan
Defined in: core/src/QObject.ts:26
Start a telemetry span for the given operation name. Returns undefined when no telemetry provider is active.
Parameters
spanName
string
Name of the span.
options?
TelemetrySpanOptions
Optional span attributes and kind.
Returns
TelemetrySpan
Inherited from
QObject.startSpan