Package-level declarations

Types

Link copied to clipboard
@Serializable
data class Cookie(val name: String, val value: String, val maxAge: Long? = null, val path: String? = null, val domain: String? = null, val secure: Boolean = false, val httpOnly: Boolean = false, val sameSite: SameSite = SameSite.Lax)

A representation of an HTTP cookie.

Link copied to clipboard
interface CookieField<T> : KovenField<T>

Interface for cookie fields, allowing type-safe retrieval and definition.

Link copied to clipboard
class CookiePairField<A, B>(val fieldA: CookieField<A>, val fieldB: CookieField<B>) : KovenPairField<A, B> , CookieField<KovenPair<A, B>>

A cookie field that combines two other cookie fields.

Link copied to clipboard
data class Cookies(val list: List<Cookie> = emptyList()) : List<Cookie>

A wrapper for cookies.

Link copied to clipboard

Represents empty fields for Headers, Query Params, Path Params, and Cookies.

Link copied to clipboard
interface HeaderField<T> : KovenField<T>

Interface for header fields.

Link copied to clipboard
class HeaderPairField<A, B>(val fieldA: HeaderField<A>, val fieldB: HeaderField<B>) : KovenPairField<A, B> , HeaderField<KovenPair<A, B>>

A header field that combines two other header fields. Used to decode KovenPair.

Link copied to clipboard

A wrapper for HTTP headers that maintains insertion order and supports multiple values. Header fields are treated case-insensitively.

Link copied to clipboard

A header field that decodes all headers into a Headers object.

Link copied to clipboard
interface KovenField<out T>

Base interface for all field decoders.

Link copied to clipboard
data class KovenPair<out A, out B>(val first: A, val second: B)

A generic pair for composing values.

Link copied to clipboard
abstract class KovenPairField<out A, out B>(val fieldA: KovenField<A>, val fieldB: KovenField<B>) : KovenField<KovenPair<A, B>>

Base class for composite fields, handling field aggregation and flattening.

Link copied to clipboard
class OptionalCookieField<T>(val inner: CookieField<T>) : CookieField<T?>

A cookie field that is optional.

Link copied to clipboard
class OptionalHeaderField<T>(val inner: HeaderField<T>) : HeaderField<T?>

A header field that is optional.

Link copied to clipboard
class OptionalPathField<T>(val inner: PathField<T>) : PathField<T?>

A path field that is optional.

Link copied to clipboard
class OptionalQueryField<T>(val inner: QueryField<T>) : QueryField<T?>

A query field that is optional.

Link copied to clipboard
interface PathField<T> : KovenField<T>

Interface for decoding path parameters on the server.

Link copied to clipboard
class PathPairField<A, B>(val fieldA: PathField<A>, val fieldB: PathField<B>) : KovenPairField<A, B> , PathField<KovenPair<A, B>>

A path field that combines two other path fields.

Link copied to clipboard
data class PathParams(val data: Map<String, String> = emptyMap()) : Map<String, String>

A wrapper for path parameters.

Link copied to clipboard
interface QueryField<T> : KovenField<T>

Interface for decoding query parameters on the server.

Link copied to clipboard
class QueryPairField<A, B>(val fieldA: QueryField<A>, val fieldB: QueryField<B>) : KovenPairField<A, B> , QueryField<KovenPair<A, B>>

A query field that combines two other query fields.

Link copied to clipboard
class QueryParams(data: Map<String, List<String>> = emptyMap()) : Map<String, List<String>>

A wrapper for query parameters that supports multiple values.

Link copied to clipboard

A header field for HTTP redirection.

Link copied to clipboard

The SameSite attribute of the cookie.

Functions

Link copied to clipboard
infix fun <A, B> A.and(other: B): KovenPair<A, B>

Creates a KovenPair from two values.

infix fun <A, B> CookieField<A>.and(other: CookieField<B>): CookiePairField<A, B>

Creates a pair of cookie fields as CookiePairField.

@JvmName(name = "andEmptyPathFieldLeft")
infix fun <B> Empty.and(other: PathField<B>): PathField<B>

Creates a pair of path fields as PathPairField, optimizing for Empty on the left.

@JvmName(name = "andEmptyQueryFieldLeft")
infix fun <B> Empty.and(other: QueryField<B>): QueryField<B>

Creates a pair of query fields as QueryPairField, optimizing for Empty on the left.

infix fun <A, B> HeaderField<A>.and(other: HeaderField<B>): HeaderPairField<A, B>

Creates a pair of header fields as HeaderPairField.

@JvmName(name = "andEmptyPathFieldRight")
infix fun <A> PathField<A>.and(other: Empty): PathField<A>

Creates a pair of path fields as PathPairField, optimizing for Empty on the right.

infix fun <A, B> PathField<A>.and(other: PathField<B>): PathPairField<A, B>

Creates a pair of path fields as PathPairField.

@JvmName(name = "andEmptyQueryFieldRight")
infix fun <A> QueryField<A>.and(other: Empty): QueryField<A>

Creates a pair of query fields as QueryPairField, optimizing for Empty on the right.

infix fun <A, B> QueryField<A>.and(other: QueryField<B>): QueryPairField<A, B>

Creates a pair of query fields as QueryPairField.

Link copied to clipboard
infix fun <T> HeaderField<T>.bind(value: T): T

Binds a value to a HeaderField for readable typed header construction. This is a pass-through that ensures the value matches the field type.

Link copied to clipboard
fun KovenPair<*, *>?.flattenPair(): List<Any?>

Flattens a KovenPair into a list of its constituent elements.

Link copied to clipboard

Marks a cookie field as optional.

Marks a header field as optional.

Marks a path field as optional.

Marks a query field as optional.