dev.cheleb.ziotapir.server

Members list

Type members

Classlikes

trait BaseController[-STREAMS <: Streams[_]]

Base trait for all controllers.

Base trait for all controllers.

This trait provides a list of routes that will be added to the server. It allows simple aggregation in the server see dev.cheleb.ziotapir.server.Routes#gatherRoutes for more information.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait SecuredBaseController[SI, Principal, STREAMS]
trait Routes[Deps]

A trait that provides a method to gather all the routes from a controllers.

A trait that provides a method to gather all the routes from a controllers.

The controllers are created in the makeControllers method, which is a ZIO effect that requires a context of type Deps. This allows the routes to have access to any dependencies they need, such as a database connection or a configuration object.

Type parameters

Deps

The type of the context that the routes require.

Attributes

Supertypes
class Object
trait Matchable
class Any
trait SecuredBaseController[SI, Principal, STREAMS <: ZioStreams](principalExtractor: SI => Task[Principal]) extends BaseController[STREAMS]

A base controller for all secured endpoints

A base controller for all secured endpoints

Value parameters

principalExtractor

the function to extract the principal from the Security Input

Attributes

Supertypes
trait BaseController[STREAMS]
class Object
trait Matchable
class Any

Extensions

Extensions

extension [R, A : JsonEncoder](stream: ZStream[R, Throwable, A])
def toJsonArrayStream: ZStream[R, Throwable, Byte]

Converts a ZStream of JSON-encodable values to a ZStream of bytes representing JSON array.

Converts a ZStream of JSON-encodable values to a ZStream of bytes representing JSON array.

Attributes

Returns

A ZStream of bytes representing JSON array.

def toJsonLinesStream: ZStream[R, Throwable, Byte]

Converts a ZStream of JSON-encodable values to a ZStream of bytes representing JSON lines.

Converts a ZStream of JSON-encodable values to a ZStream of bytes representing JSON lines.

Attributes

Returns

A ZStream of bytes representing JSON lines.