io.github.edadma.apion

Members list

Type members

Classlikes

case class AuthError(msg: String) extends ServerError

Attributes

Supertypes
trait Product
trait Equals
trait ServerError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object BodyParser

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
BodyParser.type
case class Complete(response: Response) extends Result

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Result
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class Continue(request: Request) extends Result

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Result
class Object
trait Matchable
class Any
Show all
case class Cookie(name: String, value: String, domain: Option[String], path: Option[String], maxAge: Option[Int], expires: Option[Instant], secure: Boolean, httpOnly: Boolean, sameSite: Option[String])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Cookie

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Cookie.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
trait FSInterface

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object RealFS
case class Fail(error: ServerError) extends Result

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Result
class Object
trait Matchable
class Any
Show all
object HeaderCase

HeaderCase handles case-insensitive header names while preserving original casing This is important because while HTTP header names are case-insensitive, some clients or tools may expect specific casing.

HeaderCase handles case-insensitive header names while preserving original casing This is important because while HTTP header names are case-insensitive, some clients or tools may expect specific casing.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
HeaderCase.type
object JWT

JSON Web Token (JWT) implementation supporting HS256 (HMAC-SHA256) algorithm.

JSON Web Token (JWT) implementation supporting HS256 (HMAC-SHA256) algorithm.

JWT structure: header.payload.signature

  • header: {"alg": "HS256", "typ": "JWT"}
  • payload: your custom claims as JSON
  • signature: HMAC-SHA256(base64Url(header) + "." + base64Url(payload), secret)

Each section is base64url encoded and joined with dots.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
JWT.type
implicit class JsonResponseOps[A](val data: A)(using evidence$1: JsonEncoder[A])

Attributes

Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class NotFoundError(msg: String) extends ServerError

Attributes

Supertypes
trait Product
trait Equals
trait ServerError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
trait Process

Attributes

Supertypes
class Object
trait Matchable
class Any
object RealFS extends FSInterface

Attributes

Supertypes
trait FSInterface
class Object
trait Matchable
class Any
Self type
RealFS.type
case class Request(method: String, url: String, path: String, headers: Map[String, String], params: Map[String, String], query: Map[String, String], context: Map[String, Any], rawRequest: ServerRequest, basePath: String, finalizers: List[Finalizer], cookies: Map[String, String]) extends RequestDSL

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait RequestDSL
class Object
trait Matchable
class Any
Show all
object Request

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Request.type
trait RequestDSL

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Request
Self type
case class Response(status: Int, headers: ResponseHeaders, body: String)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Response

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Response.type

ResponseHeaders wraps the header map to provide case-insensitive access while maintaining original header casing for the outgoing response

ResponseHeaders wraps the header map to provide case-insensitive access while maintaining original header casing for the outgoing response

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait Result

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Complete
class Continue
class Fail
object Skip
implicit class ResultOps(result: Future[Result])

Attributes

Supertypes
class Object
trait Matchable
class Any
object Router

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Router.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
class Server

Attributes

Supertypes
class Object
trait Matchable
class Any
sealed trait ServerError extends RuntimeException

Attributes

Supertypes
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
case object Skip extends Result

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Result
class Object
trait Matchable
class Any
Show all
Self type
Skip.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
implicit class StringResponseOps(val text: String)

Attributes

Supertypes
class Object
trait Matchable
class Any
case class ValidationError(msg: String) extends ServerError

Attributes

Supertypes
trait Product
trait Equals
trait ServerError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Types

type Finalizer = (Request, Response) => Future[Response]
type Handler = Request => Future[Result]

Value members

Concrete methods

def Created[A : JsonEncoder](data: A, location: Option[String]): Future[Result]
def base64UrlDecode(str: String): String

Decodes a base64url string back to original format. Reverses the base64url encoding:

Decodes a base64url string back to original format. Reverses the base64url encoding:

  • '-' becomes '+'
  • '_' becomes '/'
  • Adds back padding if needed

Attributes

def base64UrlEncode(str: String): String

Encodes a string to base64url format. base64url is similar to base64 but uses URL-safe characters:

Encodes a string to base64url format. base64url is similar to base64 but uses URL-safe characters:

  • '+' becomes '-'
  • '/' becomes '_'
  • Padding '=' is removed

Attributes

def decodeURIComponent(s: String): String
def encodeURIComponent(s: String): String
def generateUUID(): String
def json[A : JsonEncoder](data: A): Future[Result]
def json[A : JsonEncoder](data: A, status: Int): Future[Result]
def text(content: String): Future[Result]
def text(content: String, status: Int): Future[Result]

Concrete fields

val BadRequest: Future[Complete]
val NotFound: Future[Complete]
val ServerError: Future[Complete]
val logger: Logger

Extensions

Extensions

extension (response: Response)
def clearCookie(name: String, path: String): Response
def withCookie(cookie: Cookie): Response
def withCookie(name: String, value: String, domain: Option[String], path: Option[String], maxAge: Option[Int], expires: Option[Instant], secure: Boolean, httpOnly: Boolean, sameSite: Option[String]): Response

Implicits

Implicits

final implicit def JsonResponseOps[A : JsonEncoder](data: A): JsonResponseOps[A]
final implicit def ResultOps(result: Future[Result]): ResultOps
final implicit def StringResponseOps(text: String): StringResponseOps