nee-ctx-web-ktor / pl.setblack.nee.ctx.web / WebContext

WebContext

data class WebContext<R, G : TxProvider<R, G>> : TxProvider<R, WebContext<R, G>>, SecurityProvider<User, UserRole>, ExecutionContextProvider, TraceProvider<WebContext<R, G>>, Logging

Constructors

<init>

WebContext(jdbcProvider: TxProvider<R, G>, securityProvider: SecurityProvider<User, UserRole>, executionContextProvider: ExecutionContextProvider, errorHandler: ErrorHandler = DefaultErrorHandler, contextProvider: WebContextProvider<R, G>, traceProvider: TraceProvider<*>, applicationCall: ApplicationCall)

Functions

getConnection

fun getConnection(): TxConnection<R>

getTrace

fun getTrace(): TraceResource

serveMessage

suspend fun <E, A> serveMessage(msg: Out<E, A>): Unit
suspend fun <P> serveMessage(businessFunction: ANee<WebContext<R, G>, P, Any>, param: P): Unit

serveText

fun <P> serveText(businessFunction: ANee<WebContext<R, G>, P, String>, param: P): Unit

setConnectionState

fun setConnectionState(newState: TxConnection<R>): WebContext<R, G>

setTrace

fun setTrace(newState: TraceResource): WebContext<R, G>