Code relevant to extracting and injecting typesafe values into HTTP messages.
Name | Summary |
---|---|
BiDiBodyLens | A BiDiBodyLens provides the bi-directional extraction of an entity from a target body, or the insertion of an entity into a target body.class BiDiBodyLens<FINAL> : LensInjector <FINAL, HttpMessage >, BodyLens <FINAL> |
BiDiBodyLensSpec | Represents a bi-directional extraction of an entity from a target Body, or an insertion into a target Body.open class BiDiBodyLensSpec<OUT> : BodyLensSpec <OUT> |
BiDiLens | A BiDiLens provides the bi-directional extraction of an entity from a target, or the insertion of an entity into a target.class BiDiLens<in IN : Any , FINAL> : LensInjector <FINAL, IN>, Lens <IN, FINAL> |
BiDiLensSpec | Represents a bi-directional extraction of an entity from a target, or an insertion into a target.open class BiDiLensSpec<IN : Any , OUT> : LensSpec <IN, OUT> |
BiDiMapping | A BiDiMapping defines a reusable bidirectional transformation between an input and output typeclass BiDiMapping<IN, OUT> |
BiDiMultiLensSpec | Represents a bi-directional extraction of a list of entities from a target, or an insertion into a target.interface BiDiMultiLensSpec<IN : Any , OUT> : MultiLensSpec <IN, OUT> |
BiDiPathLens | class BiDiPathLens<FINAL> : LensInjector <FINAL, Request >, PathLens <FINAL> |
BiDiPathLensSpec | open class BiDiPathLensSpec<OUT> : PathLensSpec <OUT> |
BiDiWsMessageLens | A BiDiWsMessageLens provides the bi-directional extraction of an entity from a target body, or the insertion of an entity into a target WsMessage.class BiDiWsMessageLens<FINAL> : WsMessageLens <FINAL> |
BiDiWsMessageLensSpec | Represents a bi-directional extraction of an entity from a target Body, or an insertion into a target WsMessage.open class BiDiWsMessageLensSpec<OUT> : WsMessageLensSpec <OUT> |
BodyLens | A BodyLens provides the uni-directional extraction of an entity from a target body.open class BodyLens<out FINAL> : LensExtractor < HttpMessage , FINAL> |
BodyLensSpec | Represents a uni-directional extraction of an entity from a target Body.open class BodyLensSpec<out OUT> |
ContentNegotiation | interface ContentNegotiation |
Cookies | object Cookies : BiDiLensSpec < Request , Cookie > |
Failure | sealed class Failure |
FormField | object FormField : BiDiLensSpec < WebForm , String > |
Header | object Header : BiDiLensSpec < HttpMessage , String > |
HeaderLens | typealias HeaderLens<T> = Lens < HttpMessage , T> |
Invalid | data class Invalid : Failure |
Lens | A Lens provides the uni-directional extraction of an entity from a target.open class Lens<in IN : Any , out FINAL> : LensExtractor <IN, FINAL>, Iterable < Meta > |
LensExtractor | interface LensExtractor<in IN, out OUT> : (IN) -> OUT |
LensGet | class LensGet<in IN, out OUT> |
LensInjector | interface LensInjector<in IN, in OUT> |
LensInjectorExtractor | interface LensInjectorExtractor<IN, OUT> : LensExtractor <IN, OUT>, LensInjector <OUT, IN> |
LensSet | class LensSet<IN, in OUT> |
LensSpec | Represents a uni-directional extraction of an entity from a target.open class LensSpec<IN : Any , OUT> |
Meta | data class Meta |
Missing | data class Missing : Failure |
MultiLensSpec | Represents a uni-directional extraction of a list of entities from a target.interface MultiLensSpec<IN : Any , OUT> |
MultipartForm | data class MultipartForm : Closeable |
MultipartFormField | data class MultipartFormField |
MultipartFormFile | data class MultipartFormFile : Closeable |
ParamMeta | enum class ParamMeta |
Path | object Path : BiDiPathLensSpec < String > |
PathLens | open class PathLens<out FINAL> : Lens < Request , FINAL> |
PathLensSpec | Represents a uni-directional extraction of an entity from a target path segment.open class PathLensSpec<out OUT> |
Query | object Query : BiDiLensSpec < Request , String > |
QueryLens | typealias QueryLens<T> = Lens < Request , T> |
RequestContextKey | object RequestContextKey |
RequestContextLens | typealias RequestContextLens<T> = BiDiLens < Request , T> |
StringBiDiMappings | A set of standardised String <-> Type conversions which are used throughout http4kobject StringBiDiMappings |
Unsupported | data class Unsupported : Failure |
Validator | Runs through a list of lenses and extracts the values from each one, collecting the errorsenum class Validator |
WebForm | data class WebForm |
WsMessageLens | A WsMessageLens provides the extraction of an entity from a target WsMessage.open class WsMessageLens<out FINAL> : LensExtractor < WsMessage , FINAL> |
WsMessageLensSpec | Represents a extraction of an entity from a target WsMessage.open class WsMessageLensSpec<out OUT> |
Name | Summary |
---|---|
LensFailure | class LensFailure : Exception |
LensFailures | data class LensFailures : RuntimeException |
Name | Summary |
---|---|
CHAOS | val Header .CHAOS: BiDiLens < HttpMessage , String > |
HOST | val Header .HOST: BiDiLens < HttpMessage , Authority ?> |
MULTIPART_BOUNDARY | val MULTIPART_BOUNDARY: String |
Name | Summary |
---|---|
<no name provided> | Modes for determining if a passed content type is acceptable.fun <no name provided>(): Unit |
asResult | Convert the result of a lens extraction to a Result4k type whichfun <IN, OUT> LensExtractor <IN, OUT>.asResult(): LensExtractor <IN, Result<OUT, LensFailure >> |
authority | fun StringBiDiMappings .authority(): BiDiMapping < String , Authority > fun <IN : Any > BiDiLensSpec <IN, String >.authority(): BiDiLensSpec <IN, Authority > |
base64 | fun <IN : Any > BiDiLensSpec <IN, String >.base64(): BiDiLensSpec <IN, String > fun Path .base64(): BiDiPathLensSpec < String > |
bigDecimal | fun <IN : Any > BiDiLensSpec <IN, String >.bigDecimal(): BiDiLensSpec <IN, BigDecimal > fun Path .bigDecimal(): BiDiPathLensSpec < BigDecimal > |
bigInteger | fun <IN : Any > BiDiLensSpec <IN, String >.bigInteger(): BiDiLensSpec <IN, BigInteger > fun Path .bigInteger(): BiDiPathLensSpec < BigInteger > |
boolean | fun <IN : Any > BiDiLensSpec <IN, String >.boolean(): BiDiLensSpec <IN, Boolean > fun Path .boolean(): BiDiPathLensSpec < Boolean > |
bytes | fun <IN : Any > BiDiLensSpec <IN, String >.bytes(): LensSpec <IN, ByteArray > |
composite | This allows creation of a composite object from several values from the same source.fun <TARGET : Any , T> BiDiLensSpec <TARGET, String >.composite(fn: BiDiLensSpec <TARGET, String >.(TARGET) -> T): Lens <TARGET, T> fun <TARGET : Any , T> BiDiLensSpec <TARGET, String >.composite(getFn: BiDiLensSpec <TARGET, String >.(TARGET) -> T, setFn: T.(TARGET) -> TARGET): BiDiLens <TARGET, T> |
dateTime | fun <IN : Any > BiDiLensSpec <IN, String >.dateTime(formatter: DateTimeFormatter = ISO_LOCAL_DATE_TIME): BiDiLensSpec <IN, LocalDateTime !> fun Path .dateTime(formatter: DateTimeFormatter = ISO_LOCAL_DATE_TIME): BiDiPathLensSpec < LocalDateTime !> |
double | fun <IN : Any > BiDiLensSpec <IN, String >.double(): BiDiLensSpec <IN, Double > fun Path .double(): BiDiPathLensSpec < Double > |
duration | fun <IN : Any > BiDiLensSpec <IN, String >.duration(): BiDiLensSpec <IN, Duration !> fun Path .duration(): BiDiPathLensSpec < Duration !> |
enum | fun <IN : Any , T : Enum <T>> BiDiLensSpec <IN, String >.enum(): BiDiLensSpec <IN, T> fun <T : Enum <T>> Path .enum(): BiDiPathLensSpec <T> fun <T : Enum <T>> Query .enum(): BiDiLensSpec < Request , T> fun <T : Enum <T>> BiDiLensSpec < WebForm , String >.enum(): BiDiLensSpec < WebForm , T> |
float | fun <IN : Any > BiDiLensSpec <IN, String >.float(): BiDiLensSpec <IN, Float > fun Path .float(): BiDiPathLensSpec < Float > |
host | fun StringBiDiMappings .host(): BiDiMapping < String , Host > fun <IN : Any > BiDiLensSpec <IN, String >.host(): BiDiLensSpec <IN, Host > |
httpBodyRoot | fun httpBodyRoot(metas: List < Meta >, acceptedContentType: ContentType , contentNegotiation: ContentNegotiation ): <ERROR CLASS> |
instant | fun <IN : Any > BiDiLensSpec <IN, String >.instant(): BiDiLensSpec <IN, Instant !> fun Path .instant(): BiDiPathLensSpec < Instant !> |
int | fun <IN : Any > BiDiLensSpec <IN, String >.int(): BiDiLensSpec <IN, Int > fun Path .int(): BiDiPathLensSpec < Int > |
localDate | fun <IN : Any > BiDiLensSpec <IN, String >.localDate(formatter: DateTimeFormatter = ISO_LOCAL_DATE): BiDiLensSpec <IN, LocalDate !> fun Path .localDate(formatter: DateTimeFormatter = ISO_LOCAL_DATE): BiDiPathLensSpec < LocalDate !> |
localTime | fun <IN : Any > BiDiLensSpec <IN, String >.localTime(formatter: DateTimeFormatter = ISO_LOCAL_TIME): BiDiLensSpec <IN, LocalTime !> fun Path .localTime(formatter: DateTimeFormatter = ISO_LOCAL_TIME): BiDiPathLensSpec < LocalTime !> |
long | fun <IN : Any > BiDiLensSpec <IN, String >.long(): BiDiLensSpec <IN, Long > fun Path .long(): BiDiPathLensSpec < Long > |
map | fun <NEXT, IN : Any , OUT> BiDiLensSpec <IN, OUT>.map(mapping: BiDiMapping <OUT, NEXT>): BiDiLensSpec <IN, NEXT> |
matches | Check the content of any lens on a request for routing purposes.fun <T> Lens < Request , T>.matches(fn: (T) -> Boolean ): Router |
nonEmptyString | fun <IN : Any > BiDiLensSpec <IN, String >.nonEmptyString(): BiDiLensSpec <IN, String > fun Path .nonEmptyString(): BiDiPathLensSpec < String > |
offsetDateTime | fun <IN : Any > BiDiLensSpec <IN, String >.offsetDateTime(formatter: DateTimeFormatter = ISO_OFFSET_DATE_TIME): BiDiLensSpec <IN, OffsetDateTime !> |
offsetTime | fun <IN : Any > BiDiLensSpec <IN, String >.offsetTime(formatter: DateTimeFormatter = ISO_OFFSET_TIME): BiDiLensSpec <IN, OffsetTime !> |
port | fun StringBiDiMappings .port(): BiDiMapping < String , Port > fun <IN : Any > BiDiLensSpec <IN, String >.port(): BiDiLensSpec <IN, Port > |
regex | fun <IN : Any > BiDiLensSpec <IN, String >.regex(pattern: String , group: Int = 1): BiDiLensSpec <IN, String > fun Path .regex(pattern: String , group: Int = 1): BiDiPathLensSpec < String > |
regexObject | fun <IN : Any > BiDiLensSpec <IN, String >.regexObject(): BiDiLensSpec <IN, Regex > fun Path .regexObject(): BiDiPathLensSpec < Regex > |
secret | fun <IN : Any > BiDiLensSpec <IN, String >.secret(): LensSpec <IN, Secret > |
string | fun <IN : Any > BiDiLensSpec <IN, String >.string(): BiDiLensSpec <IN, String > fun Path .string(): Path |
timeout | fun <IN : Any > BiDiLensSpec <IN, String >.timeout(): BiDiLensSpec <IN, Timeout > |
uri | fun <IN : Any > BiDiLensSpec <IN, String >.uri(): BiDiLensSpec <IN, Uri > fun Path .uri(): BiDiPathLensSpec < Uri > |
uuid | fun <IN : Any > BiDiLensSpec <IN, String >.uuid(): BiDiLensSpec <IN, UUID !> fun Path .uuid(): BiDiPathLensSpec < UUID !> |
yearMonth | fun <IN : Any > BiDiLensSpec <IN, String >.yearMonth(): BiDiLensSpec <IN, YearMonth !> fun Path .yearMonth(): BiDiPathLensSpec < YearMonth !> |
zonedDateTime | fun <IN : Any > BiDiLensSpec <IN, String >.zonedDateTime(formatter: DateTimeFormatter = ISO_ZONED_DATE_TIME): BiDiLensSpec <IN, ZonedDateTime !> fun Path .zonedDateTime(formatter: DateTimeFormatter = ISO_ZONED_DATE_TIME): BiDiPathLensSpec < ZonedDateTime !> |
Name | Summary |
---|---|
binary | fun Body.Companion.binary(contentType: ContentType , description: String ? = null, contentNegotiation: ContentNegotiation = None): <ERROR CLASS> fun WsMessage.Companion.binary(): <ERROR CLASS> |
multipartForm | fun Body.Companion.multipartForm(validator: Validator , vararg parts: Lens < MultipartForm , *>, defaultBoundary: String = MULTIPART_BOUNDARY, diskThreshold: Int = DEFAULT_DISK_THRESHOLD, contentTypeFn: ( String ) -> ContentType = ::MultipartFormWithBoundary): BiDiBodyLensSpec < MultipartForm > |
nonEmptyString | fun Body.Companion.nonEmptyString(contentType: ContentType , description: String ? = null, contentNegotiation: ContentNegotiation = None): <ERROR CLASS> |
regex | fun Body.Companion.regex(pattern: String , group: Int = 1, contentType: ContentType = ContentType.TEXT_PLAIN, description: String ? = null, contentNegotiation: ContentNegotiation = None): <ERROR CLASS> |
string | fun Body.Companion.string(contentType: ContentType , description: String ? = null, contentNegotiation: ContentNegotiation = None): <ERROR CLASS> fun WsMessage.Companion.string(): <ERROR CLASS> |
webForm | fun Body.Companion.webForm(validator: Validator , vararg formFields: Lens < WebForm , *>): BiDiBodyLensSpec < WebForm > |