You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, command middleware is pretty limited because:
It can not capture the responses in any way. Traditionally, in an http middleware I could do something like this:
returnfunc(handler slacker.CommandHandler) slacker.CommandHandler {
returnfunc(cmdCtx*slacker.CommandContext) {
ctx:=context.WithValue(cmdCtx.Context(), "test", "value")
// in gin this would be c.Request.WithContext (or c.WithContext in net/httpcmdCtx.WithContext(ctx)
next()
// within the next method I could query this context
}
}
There's nothing like that at all. For an example use case, you could do thing s like otel with this. I've put together an example here w/o the context pass down
It would also be very standard to be able to capture the response after next() is called.
This could either be done by overwriting the writer, or with a hook on reply
The text was updated successfully, but these errors were encountered:
Ability to inherit context in middleware
Right now, command middleware is pretty limited because:
There's nothing like that at all. For an example use case, you could do thing s like otel with this. I've put together an example here w/o the context pass down
It would also be very standard to be able to capture the response after next() is called.
This could either be done by overwriting the writer, or with a hook on reply
The text was updated successfully, but these errors were encountered: