dev.cheleb.ziolaminartapir

Members list

Type members

Classlikes

final case class BackendClientConfig(baseUrl: Uri)

Configuration for the backend client.

Configuration for the backend client.

Attributes

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

A client to the backend, extending the endpoints as methods.

A client to the backend, extending the endpoints as methods.

This client is used to call the backend from the frontend, but base URI must be provided at each call.

Attributes

Supertypes
class Object
trait Matchable
class Any

The live implementation of the BackendClient with a different origin.

The live implementation of the BackendClient with a different origin.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class RestrictedEndpointException(message: String) extends RuntimeException

Typed exception for restricted endpoints.

Typed exception for restricted endpoints.

Attributes

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

A client to the backend, extending the endpoints as methods.

A client to the backend, extending the endpoints as methods.

Attributes

Supertypes
class Object
trait Matchable
class Any

The live implementation of the BackendClient.

The live implementation of the BackendClient.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
trait Session[UserToken <: WithToken]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class SessionLive[UserToken]
class SessionLive[UserToken <: WithToken](using x$1: JsonCodec[UserToken]) extends Session[UserToken]

Attributes

Supertypes
trait Session[UserToken]
class Object
trait Matchable
class Any
object Storage

Attributes

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

Types

type ZioStreamsWithWebSockets = ZioStreams & WebSockets

Extension methods for ZIO JS.

Extension methods for ZIO JS.

Extension are of two kinds:

  • targeting Endpoints: allowing to call an endpoint with a payload
  • targeting ZIO: allowing to run a ZIO in JS

Also, there are two kinds of ZIO, and associated 2 extensions:

  • SameOriginBackendClient: for requests to the same origin
  • DifferentOriginBackendClient: for requests to a different origin

Attributes

Extensions

Extensions

extension [I, E <: Throwable, O](endpoint: Endpoint[Unit, I, E, O, Any])
def apply(payload: I): RIO[SameOriginBackendClient, O]

Call the endpoint with a payload, and get a ZIO back.

Call the endpoint with a payload, and get a ZIO back.

Attributes

def on(baseUri: Uri)(payload: I): RIO[DifferentOriginBackendClient, O]

Call the endpoint with a payload on a different backend than the origin, and get a ZIO back.

Call the endpoint with a payload on a different backend than the origin, and get a ZIO back.

Attributes

extension [I, E <: Throwable, O](endpoint: Endpoint[String, I, E, O, Any])
def apply[UserToken <: WithToken](payload: I)(using session: Session[UserToken]): RIO[SameOriginBackendClient, O]

Call the secured endpoint with a payload, and get a ZIO back.

Call the secured endpoint with a payload, and get a ZIO back.

Attributes

def on[UserToken <: WithToken](baseUri: Uri)(payload: I)(using session: Session[UserToken]): RIO[DifferentOriginBackendClient, O]

Call the secured endpoint with a payload on a different backend than the origin, and get a ZIO back.

Call the secured endpoint with a payload on a different backend than the origin, and get a ZIO back.

Attributes

extension [E <: Throwable, A](zio: ZIO[SameOriginBackendClient, E, A])
def emitTo(bus: EventBus[A]): Unit

Emit the result of the ZIO to an EventBus.

Emit the result of the ZIO to an EventBus.

Underlying request to the default backend.

Attributes

def emitTo(bus: EventBus[A], error: EventBus[E]): Unit

Emit the result and error of the ZIO to an EventBus.

Emit the result and error of the ZIO to an EventBus.

Underlying request to the default backend.

Attributes

def emitToEither(bus: EventBus[Either[E, A]]): Unit

Emit the result of the ZIO to an EventBus of Either.

Emit the result of the ZIO to an EventBus of Either.

Underlying request to the default backend.

Value parameters

bus

event bus to emit the result to

Attributes

def runJs: Unit

Run the ZIO in JS.

Run the ZIO in JS.

Attributes

def runJs(errorBus: EventBus[E]): Unit

Run the ZIO in JS, and emit the error to an EventBus.

Run the ZIO in JS, and emit the error to an EventBus.

Value parameters

errorBus

the event bus to emit the error to

Attributes

def toEventStream: EventStream[A]

Emit the result of the ZIO to an EventBus, and return the EventStream.

Emit the result of the ZIO to an EventBus, and return the EventStream.

Attributes

extension [E <: Throwable, A](zio: ZIO[DifferentOriginBackendClient, E, A])
def emitTo(bus: EventBus[A]): Unit

Emit the result of the ZIO to an EventBus.

Emit the result of the ZIO to an EventBus.

Underlying request to the default backend.

Attributes

def emitTo(bus: EventBus[A], error: EventBus[E]): Unit

Emit the result and error of the ZIO to an EventBus.

Emit the result and error of the ZIO to an EventBus.

Underlying request to the default backend.

Attributes

def emitToEither(bus: EventBus[Either[E, A]]): Unit

Emit the result of the ZIO to an EventBus of Either.

Emit the result of the ZIO to an EventBus of Either.

Underlying request to the default backend.

Value parameters

bus

event bus to emit the result to

Attributes

def runJs: Unit

Run the ZIO in JS.

Run the ZIO in JS.

Attributes

def runJs(errorBus: EventBus[E]): Unit

Run the ZIO in JS, and emit the error to an EventBus.

Run the ZIO in JS, and emit the error to an EventBus.

Value parameters

errorBus

the event bus to emit the error to

Attributes

def toEventStream: EventStream[A]

Emit the result of the ZIO to an EventBus, and return the EventStream.

Emit the result of the ZIO to an EventBus, and return the EventStream.

Attributes