Closed nikmd23 closed 9 years ago
Initial work has been done here. Still need to write in IInspector
s to actually be executed. This involves creating a IInspectorStartup which processes/runs all the registered IInspector
s that are registered with the IInspectorProvider
.
Work finished, pulling it in.
High Level
Glimpse inspects requests with the usage of inspectors, which typically publish messages to the message broker for storage and consumption by a client.
From a high level, inspectors in Glimpse 2.0 will be pieces of middleware.
There are two API's available:
Detailed Breakdown
High Level
To use the high level API, users must implement
IInspector
An example implementation:
Users can alternatively extend the
Inspector
class to override justBefore
orAfter
if they prefer. Like all ASP.NET 5 components, dependency injection is fully supported, as shown with the injectedIMessageBroker
in the example.Low Level
The low level API tracks much more closely with standard middleware, and in fact, standard middleware can be used as an inspector.
The interface to be implemented is
IInspectorStartup
:A sample implementation:
The low level API allows implementors to register multiple inspectors at once via
IInspectorBuilder.Use()
. Implementors can also access theIApplicationBuilder
viaIInspectorBuilder.Application
.The full
IInspectorBuilder
is defined as follows:Other Considerations
Need To Implement