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.

JSON

object JSON

JSON utility functions

KVHandler

open class KVHandler

KVRemoteAgent

open class KVRemoteAgent<T : Any> : RemoteAgent

Client side agent for JSON-RPC remote calls.

KVRouterConfiguration

open class KVRouterConfiguration

KVServiceManager

open actual class KVServiceManager<T : Any>

Multiplatform service manager.

KVWebSocketConfig

open class KVWebSocketConfig

KVWebSocketHandler

class KVWebSocketHandler

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.

WithPrincipal

interface WithPrincipal

WithProfile

interface WithProfile

WithRequest

interface WithRequest

WithWebSession

interface WithWebSession

WithWebSocketSession

interface WithWebSocketSession

Exceptions

SecurityException

class SecurityException : Exception

A security exception.

SocketClosedException

class SocketClosedException : Throwable

Websocket closed exception class.

Type Aliases

Id

actual typealias Id = Id

Profile

actual typealias Profile = <ERROR CLASS>

A user profile.

Transient

actual typealias Transient = Transient

Properties

HTTP_UNAUTHORIZED

const val HTTP_UNAUTHORIZED: Int

HTTP status unauthorized (401).

injector

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

injectorKey

val injectorKey: <ERROR CLASS>

Functions

applyRoutes

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

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

getServerWebExchangeMatcher

fun getServerWebExchangeMatcher(vararg services: KVServiceManager<*>): Array<<ERROR CLASS>>

A function to gather paths for spring security matchers.

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.

serviceMatchers

fun <ERROR CLASS>.serviceMatchers(vararg services: KVServiceManager<*>): <ERROR CLASS>
fun serviceMatchers(vararg services: KVServiceManager<*>): <ERROR CLASS>

A function to gather paths for spring security matchers.

withProfile

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

A helper extension function for processing with authenticated user profile.