ktor-server-core / io.ktor.util

Package io.ktor.util

Types

ConversionService

interface ConversionService

Data conversion service that does serialization and deserialization to/from list of strings

CopyOnWriteHashMap

class CopyOnWriteHashMap<K : Any, V : Any>

This is an internal implementation for copy-on-write concurrent map. It is very limited since it is not intended as general purpose implementation.

DefaultConversionService

object DefaultConversionService : ConversionService

The default conversion service that supports only basic types and enums

DispatcherWithShutdown

class DispatcherWithShutdown : CoroutineDispatcher

Specialized dispatcher useful for graceful shutdown

Exceptions

DataConversionException

class DataConversionException : DataConversionException

Thrown when failed to convert value

Extensions for External Classes

java.util.Date

kotlin.collections.List

Properties

GreenwichMeanTime

val GreenwichMeanTime: ZoneId

ZoneId for GMT

Functions

getOrFail

fun Parameters.getOrFail(name: String): String

Get parameters value associated with this name or fail with MissingRequestParameterException

getValue

operator fun <R : Any> Parameters.getValue(thisRef: Any?, property: KProperty<*>): R

Operator function that allows to delegate variables by call parameters. It does conversion to type R using DefaultConversionService

url

fun url(block: URLBuilder.() -> Unit): String

Construct a URL

fun ApplicationCall.url(block: URLBuilder.() -> Unit = {}): String

Creates an url using current call's schema, path and parameters as initial and then invokes block function on the url builder so amend parameters

Companion Object Functions

createFromCall

fun URLBuilder.Companion.createFromCall(call: ApplicationCall): URLBuilder

Creates an url using current call's schema, path and parameters as initial