Skip to content

Index

port_http_server / com.hexagonkt.http.server

Package com.hexagonkt.http.server

This package defines the classes used in the HTTP DSL.

Types

Name Summary
Call HTTP request context. It holds client supplied data and methods to change the response.class Call
CorsSettings HTTP CORS setting. It holds info for CORS.data class CorsSettings
ErrorCodeCallback Alias for errors' callbacks. Functions executed to handle a HTTP error code.typealias ErrorCodeCallback =Call.(CodedException) ->Unit
ExceptionCallback Alias for exceptions' callbacks. Functions executed when an exception is thrown.typealias ExceptionCallback =Call.(Exception) ->Unit
FilterOrder Type of filter. Indicates when the filter is executed.enum class FilterOrder
PortHttpServerSamplesTest abstract class PortHttpServerSamplesTest
Request Lists would be initialized loading all elements when they are used (set it as lazy in implementations) this will have a performance penalty in favor of ease of use. The alternative would be using a 'Map/List wrapper that delegates calls to abstract methods in the interface (I won't do this just now).class Request
RequestHandler Base class for request handlers.sealed class RequestHandler
RequestPort interface RequestPort
Response Check 'Request' comment. And also note that lists should be updated by engines after callback is processed, this data is like a buffer that needs to be dumped to the real response.class Response
ResponsePort interface ResponsePort
RouteCallback Alias for routes' and filters' callbacks. Functions executed when a route is matched.typealias RouteCallback =Call.() ->Unit
Router Creates and initializes a Router based on a code block.class Router
Server Server that listen to HTTP connections on a port and address and route requests using a router.data class Server
ServerFeature Toolkit feature that may or may not be implemented by a server adapter.enum class ServerFeature
ServerPort Server instance of one kind.interface ServerPort
ServerSettings Holds server settings info.data class ServerSettings
Session Provides session information.class Session
SessionPort interface SessionPort
UnsupportedSessionAdapter object UnsupportedSessionAdapter :SessionPort

Functions

Name Summary
serve Create a server and start it.fun serve(settings:ServerSettings= ServerSettings(), router:Router, adapter:ServerPort= InjectionManager.inject()):Server
fun serve(settings:ServerSettings= ServerSettings(), adapter:ServerPort= InjectionManager.inject(), block:Router.() ->Unit):Server

Comments