kvision / pl.treksoft.kvision.remote

Package pl.treksoft.kvision.remote

A set of components for creating multiplatform automatic JSON-RPC connectivity with a backend server.

Types

CallAgent

open class CallAgent

An agent responsible for remote calls.

Credentials

data class Credentials

Username and password credentials.

DummyWebSocketSession

open class DummyWebSocketSession

JSON

object JSON

JSON utility functions

KVController

open class KVController

Controller for handling automatic routes.

KVRemoteAgent

open class KVRemoteAgent<T : Any> : RemoteAgent

Client side agent for JSON-RPC remote calls.

KVServiceManager

open actual class KVServiceManager<T : Any>

Multiplatform service manager.

KVWebSocketConfig

open class KVWebSocketConfig

Automatic websockets configuration.

LoginService

class LoginService

Form login dispatcher.

Object

external class Object

JavaScript Object type

Profile

actual data class Profile

A user profile.

RemoteAgent

interface RemoteAgent

Interface for client side agent for JSON-RPC remote calls.

SecurityMgr

abstract class SecurityMgr

Form login dispatcher.

Socket

class Socket

A websocket client implementation.

WebSocketSessionHolder

object WebSocketSessionHolder

Exceptions

SecurityException

class SecurityException : Exception

A security exception.

SocketClosedException

class SocketClosedException : Throwable

Websocket closed exception class.

Type Aliases

Profile

actual typealias Profile = <ERROR CLASS>

A user profile.

Properties

HTTP_UNAUTHORIZED

const val HTTP_UNAUTHORIZED: Int

HTTP status unauthorized (401).

injector

val <ERROR CLASS>.injector: <ERROR CLASS>

injectorKey

val injectorKey: <ERROR CLASS>

KV_ROUTE_ID_ATTRIBUTE

const val KV_ROUTE_ID_ATTRIBUTE: String

Functions

addPathPatternsFromServices

fun <ERROR CLASS>.addPathPatternsFromServices(services: List<KVServiceManager<*>>): Unit

A function to gather paths for an interceptor from a list of service managers.

applyRoutes

fun <T : Any> <ERROR CLASS>.applyRoutes(serviceManager: KVServiceManager<T>): Unit

A function to generate routes based on definitions from the service manager.

getWebSocketUrl

fun getWebSocketUrl(url: String): String

Creates a websocket URL from current window.location and given path.

kvisionInit

fun <ERROR CLASS>.kvisionInit(): Unit

Initialization function for Jooby server.

fun <ERROR CLASS>.kvisionInit(vararg modules: <ERROR CLASS>): Unit

Initialization function for Ktor server.

obj

fun obj(init: dynamic.() -> Unit): dynamic

Helper function for creating JavaScript objects.

withProfile

suspend fun <RESP> <ERROR CLASS>.withProfile(block: suspend (Profile) -> RESP): RESP
suspend fun <RESP> withProfile(block: suspend (Profile) -> RESP): RESP

A helper extension function for processing with authenticated user profile.