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
implicit class BufferResponseOps(val buffer: Buffer)

Attributes

Supertypes
class Object
trait Matchable
class Any
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 ContentBody(content: Buffer) extends ResponseBody

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ResponseBody
class Object
trait Matchable
class Any
Show all
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
case object EmptyBody extends ResponseBody

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait ResponseBody
class Object
trait Matchable
class Any
Show all
Self type
EmptyBody.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 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])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
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
case class Response(status: Int, headers: ResponseHeaders, body: ResponseBody)

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
sealed trait ResponseBody

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ContentBody
object EmptyBody
class TextBody

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

ResponseHeaders wraps the header map to provide case-insensitive access while maintaining canonical 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

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Router.type
class Router extends Handler

Attributes

Companion
object
Supertypes
trait Request => Future[Result]
class Object
trait Matchable
class Any

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 TextBody(content: String, encoding: String, data: Buffer) extends ResponseBody

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ResponseBody
class Object
trait Matchable
class Any
Show all
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 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 created[A : JsonEncoder](data: A, location: Option[String]): Future[Result]
def decodeURIComponent(s: String): String
def encodeURIComponent(s: String): String
def fail(error: ServerError): Future[Result]
def failAuth(msg: String): Future[Result]
def failNotFound(msg: String): Future[Result]
def failValidation(msg: String): Future[Result]
def generateUUID(): String
def json[A : JsonEncoder](data: A): Future[Result]
def json[A : JsonEncoder](data: A, status: Int): Future[Result]
def noContent: Future[Complete]
def skip: Future[Result]
def text(content: String): Future[Result]
def text(content: String, status: Int): Future[Result]

Concrete fields

val badRequest: Future[Complete]
val logger: Logger
val notFound: Future[Complete]
val serverError: Future[Complete]

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 BufferResponseOps(buffer: Buffer): BufferResponseOps
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