Class EndpointMiddleware<TRequest, TResponse>
- Namespace
- Steeltoe.Management.Endpoint.Middleware
- Assembly
- Steeltoe.Management.Endpoint.dll
public abstract class EndpointMiddleware<TRequest, TResponse> : IEndpointMiddleware, IMiddleware
Type Parameters
TRequestTResponse
- Inheritance
-
EndpointMiddleware<TRequest, TResponse>
- Implements
- Inherited Members
Constructors
EndpointMiddleware(IEndpointHandler<TRequest, TResponse>, IOptionsMonitor<ManagementOptions>, ILoggerFactory)
protected EndpointMiddleware(IEndpointHandler<TRequest, TResponse> endpointHandler, IOptionsMonitor<ManagementOptions> managementOptionsMonitor, ILoggerFactory loggerFactory)
Parameters
endpointHandlerIEndpointHandler<TRequest, TResponse>managementOptionsMonitorIOptionsMonitor<ManagementOptions>loggerFactoryILoggerFactory
Properties
EndpointHandler
protected IEndpointHandler<TRequest, TResponse> EndpointHandler { get; }
Property Value
- IEndpointHandler<TRequest, TResponse>
EndpointOptions
public EndpointOptions EndpointOptions { get; }
Property Value
ManagementOptionsMonitor
protected IOptionsMonitor<ManagementOptions> ManagementOptionsMonitor { get; }
Property Value
Methods
CanInvoke(PathString)
public virtual bool CanInvoke(PathString requestPath)
Parameters
requestPathPathString
Returns
GetMetadataProvider()
public virtual ActuatorMetadataProvider GetMetadataProvider()
Returns
InvokeAsync(HttpContext, RequestDelegate?)
Request handling method.
public Task InvokeAsync(HttpContext context, RequestDelegate? next)
Parameters
contextHttpContextThe HttpContext for the current request.
nextRequestDelegateThe delegate representing the remaining middleware in the request pipeline.
Returns
InvokeEndpointHandlerAsync(TRequest?, CancellationToken)
protected abstract Task<TResponse> InvokeEndpointHandlerAsync(TRequest? request, CancellationToken cancellationToken)
Parameters
requestTRequestcancellationTokenCancellationToken
Returns
- Task<TResponse>
ParseRequestAsync(HttpContext, CancellationToken)
protected virtual Task<TRequest?> ParseRequestAsync(HttpContext httpContext, CancellationToken cancellationToken)
Parameters
httpContextHttpContextcancellationTokenCancellationToken
Returns
- Task<TRequest>
WriteResponseAsync(TResponse, HttpContext, CancellationToken)
protected virtual Task WriteResponseAsync(TResponse response, HttpContext httpContext, CancellationToken cancellationToken)
Parameters
responseTResponsehttpContextHttpContextcancellationTokenCancellationToken