aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-common-remote/src/main/kotlin
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-02-11 23:02:40 +0100
committerRobert Jaros <rjaros@finn.pl>2019-02-11 23:02:40 +0100
commitc0b7927e19bb5ec4cd0c3b973486a85f4a1ff56a (patch)
treeec0ea1304f242de3ecc123e55979b03325ab41be /kvision-modules/kvision-common-remote/src/main/kotlin
parent0d32732cfa8e0b359e1fd13523a6eb4356c97441 (diff)
downloadkvision-c0b7927e19bb5ec4cd0c3b973486a85f4a1ff56a.tar.gz
kvision-c0b7927e19bb5ec4cd0c3b973486a85f4a1ff56a.tar.bz2
kvision-c0b7927e19bb5ec4cd0c3b973486a85f4a1ff56a.zip
Refactoring of server side components.
Diffstat (limited to 'kvision-modules/kvision-common-remote/src/main/kotlin')
-rw-r--r--kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt43
1 files changed, 18 insertions, 25 deletions
diff --git a/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
index 224a8542..514fb07d 100644
--- a/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
+++ b/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt
@@ -23,13 +23,6 @@ package pl.treksoft.kvision.remote
import kotlin.reflect.KClass
-enum class RpcHttpMethod {
- POST,
- PUT,
- DELETE,
- OPTIONS
-}
-
enum class HttpMethod {
GET,
POST,
@@ -46,73 +39,73 @@ expect open class KVServiceManager<T : Any>(serviceClass: KClass<T>) {
/**
* Binds a given route with a function of the receiver.
* @param function a function of the receiver
- * @param route a route
* @param method a HTTP method
+ * @param route a route
*/
protected inline fun <reified RET> bind(
noinline function: suspend T.() -> RET,
- route: String? = null,
- method: RpcHttpMethod = RpcHttpMethod.POST
+ method: HttpMethod = HttpMethod.POST,
+ route: String? = null
)
/**
* Binds a given route with a function of the receiver.
* @param function a function of the receiver
- * @param route a route
* @param method a HTTP method
+ * @param route a route
*/
protected inline fun <reified PAR, reified RET> bind(
noinline function: suspend T.(PAR) -> RET,
- route: String? = null,
- method: RpcHttpMethod = RpcHttpMethod.POST
+ method: HttpMethod = HttpMethod.POST,
+ route: String? = null
)
/**
* Binds a given route with a function of the receiver.
* @param function a function of the receiver
- * @param route a route
* @param method a HTTP method
+ * @param route a route
*/
protected inline fun <reified PAR1, reified PAR2, reified RET> bind(
noinline function: suspend T.(PAR1, PAR2) -> RET,
- route: String? = null,
- method: RpcHttpMethod = RpcHttpMethod.POST
+ method: HttpMethod = HttpMethod.POST,
+ route: String? = null
)
/**
* Binds a given route with a function of the receiver.
* @param function a function of the receiver
- * @param route a route
* @param method a HTTP method
+ * @param route a route
*/
protected inline fun <reified PAR1, reified PAR2, reified PAR3, reified RET> bind(
noinline function: suspend T.(PAR1, PAR2, PAR3) -> RET,
- route: String? = null,
- method: RpcHttpMethod = RpcHttpMethod.POST
+ method: HttpMethod = HttpMethod.POST,
+ route: String? = null
)
/**
* Binds a given route with a function of the receiver.
* @param function a function of the receiver
- * @param route a route
* @param method a HTTP method
+ * @param route a route
*/
protected inline fun <reified PAR1, reified PAR2, reified PAR3, reified PAR4, reified RET> bind(
noinline function: suspend T.(PAR1, PAR2, PAR3, PAR4) -> RET,
- route: String? = null,
- method: RpcHttpMethod = RpcHttpMethod.POST
+ method: HttpMethod = HttpMethod.POST,
+ route: String? = null
)
/**
* Binds a given route with a function of the receiver.
* @param function a function of the receiver
- * @param route a route
* @param method a HTTP method
+ * @param route a route
*/
protected inline fun <reified PAR1, reified PAR2, reified PAR3, reified PAR4, reified PAR5, reified RET> bind(
noinline function: suspend T.(PAR1, PAR2, PAR3, PAR4, PAR5) -> RET,
- route: String? = null,
- method: RpcHttpMethod = RpcHttpMethod.POST
+ method: HttpMethod = HttpMethod.POST,
+ route: String? = null
)
/**