dev.cheleb.ziotapir.laminar

Members list

Type members

Classlikes

trait Session[UserToken <: WithToken]

A session management interface for Laminar applications.

A session management interface for Laminar applications.

Type parameters

UserToken

The type of the user token, which should extend dev.cheleb.ziojwt.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

Extensions

Extensions

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

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

Call the endpoint with a payload, 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[BackendClient, 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

extension [I, O](endpoint: Endpoint[Unit, I, Throwable, Stream[Throwable, O], ZioStreams])
def apply(payload: I): RIO[BackendClient, Stream[Throwable, O]]

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

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

Attributes

extension [I, O](endpoint: Endpoint[String, I, Throwable, Stream[Throwable, O], ZioStreams])
def apply[UserToken <: WithToken](payload: I)(using session: Session[UserToken]): RIO[BackendClient, Stream[Throwable, O]]

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

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

Attributes

extension (stream: ZStream[Any, Throwable, Byte])
def parse[O : JsonCodec]: ZStream[Any, Throwable, Either[String, O]]
extension [E <: Throwable, A](zio: ZIO[BackendClient, E, A])
def emit(bus: EventBus[A]): Unit

Run zio on same origin and emit the result to an EventBus.

Run zio on same origin and emit the result to an EventBus.

Prints the error to the console if the ZIO fails.

Type parameters

A

the type of the result

Value parameters

bus

event bus to emit the result to

Attributes

def emit(uri: Uri, bus: EventBus[A]): Unit

Run zio on different origin and emit the result to an EventBus.

Run zio on different origin and emit the result to an EventBus.

Prints the error to the console if the ZIO fails.

Type parameters

A

the type of the result

Value parameters

bus

event bus to emit the result to

Attributes

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

Run zio on same origin and emit the result and error of the ZIO to an EventBus.

Run zio on same origin and emit the result and error of the ZIO to an EventBus.

Value parameters

bus

event bus to emit the result to

error

event bus to emit the error to

Attributes

def emit(uri: Uri, bus: EventBus[A], error: EventBus[E]): Unit

Run zio on different origin and emit the result and error of the ZIO to an EventBus.

Run zio on different origin and emit the result and error of the ZIO to an EventBus.

Value parameters

bus

event bus to emit the result to

error

event bus to emit the error to

Attributes

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

Run zio on same origin and emit the result of the ZIO to an EventBus of Either.

Run zio on same origin and 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 emitEither(uri: Uri, bus: EventBus[Either[E, A]]): Unit

Run zio on different origin and emit the result of the ZIO to an EventBus of Either.

Run zio on different origin and emit the result of the ZIO to an EventBus of Either.

Underlying request to the default backend.

Type parameters

A

the type of the result

E

the type of the error

Value parameters

bus

event bus to emit the result to

uri

the URI to run the request on

Attributes

def run: Unit

Run the ZIO in JS and print the error to the console.

Run the ZIO in JS and print the error to the console.

This method is useful for debugging, as it will print the error message to the console if the ZIO fails.

Attributes

def run(uri: Uri): Unit

Run the ZIO in JS and print the error to the console.

Run the ZIO in JS and print the error to the console.

This method is useful for debugging, as it will print the error message to the console if the ZIO fails. *

Attributes

def run(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 run(uri: Uri, errorBus: EventBus[E]): Unit

Run the ZIO in JS on a specific URI, and emit the error to an EventBus.

Run the ZIO in JS on a specific URI, and emit the error to an EventBus.

Value parameters

errorBus

the event bus to emit the error to

uri

the URI to run the request on

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

def toEventStream(uri: Uri): 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 (zio: ZIO[BackendClient, Throwable, ZStream[Any, Throwable, Byte]])
def jsonl[O : JsonCodec](uri: Uri)(f: O => Unit): Unit

Parse a JSONL stream from a URI (different from origin) as a stream of O and apply a function to each one to Unit.

Parse a JSONL stream from a URI (different from origin) as a stream of O and apply a function to each one to Unit.

Type parameters

O

the type of the parsed object, which must have a JsonCodec instance available.

Value parameters

f

function to apply

Attributes

def jsonl[O : JsonCodec](f: O => Unit): Unit

Parse a JSONL stream as a stream of O and apply a function to each one to Unit.

Parse a JSONL stream as a stream of O and apply a function to each one to Unit.

Type parameters

O

the type of the parsed object, which must have a JsonCodec instance available.

Value parameters

f

function to apply

Attributes

def jsonlEither[O : JsonCodec](f: (Either[String, O]) => Unit): Unit

Parse a JSONL stream as a stream of Either[String, O] and apply a function to each one to Unit.

Parse a JSONL stream as a stream of Either[String, O] and apply a function to each one to Unit.

Type parameters

O

the type of the parsed object, which must have a JsonCodec instance available.

Value parameters

f

function to apply

Attributes

def jsonlEither[O : JsonCodec](uri: Uri)(f: (Either[String, O]) => Unit): Unit

Parse a JSONL stream from a URI (different from origin) as a stream of Either[String, O] and apply a function to each one to Unit.

Parse a JSONL stream from a URI (different from origin) as a stream of Either[String, O] and apply a function to each one to Unit.

Type parameters

O

the type of the parsed object, which must have a JsonCodec instance available.

Value parameters

f

function to apply

Attributes

def jsonlEitherZIO[O : JsonCodec](f: (Either[String, O]) => Task[Unit]): Unit

Parse a JSONL stream as a stream of Either[String, O] and apply a function to each one to Task[Unit].

Parse a JSONL stream as a stream of Either[String, O] and apply a function to each one to Task[Unit].

Type parameters

O

the type of the parsed object, which must have a JsonCodec instance available.

Value parameters

f

function to apply

Attributes

def jsonlEitherZIO[O : JsonCodec](uri: Uri)(f: (Either[String, O]) => Task[Unit]): Unit

Parse a JSONL stream as a stream of Either[String, O] and apply a function to each one to Task[Unit].

Parse a JSONL stream as a stream of Either[String, O] and apply a function to each one to Task[Unit].

Type parameters

O

the type of the parsed object, which must have a JsonCodec instance available.

Value parameters

f

function to apply

Attributes

def jsonlFoldEitherZIO[S, O : JsonCodec](s: S)(f: (S, Either[String, O]) => Task[S]): Unit

Parse a JSONL stream and fold it over a state.

Parse a JSONL stream and fold it over a state.

Type parameters

O

the type of the parsed object, which must have a JsonCodec instance available.

S

the type of the state to fold over the stream

Value parameters

f

function to apply

s

initial state to fold over the stream

Attributes

Returns

a ZIO that returns the final state after folding over the stream.

def jsonlFoldEitherZIO[S, O : JsonCodec](uri: Uri, s: S)(f: (S, Either[String, O]) => Task[S]): Unit

Parse a JSONL stream from a URI (different from origin) and fold it over a state.

Parse a JSONL stream from a URI (different from origin) and fold it over a state.

Type parameters

O

the type of the parsed object, which must have a JsonCodec instance available.

S

the type of the state to fold over the stream

Value parameters

f

function to apply

s

initial state to fold over the stream

uri

the URI to run the request on

Attributes

Returns

a ZIO that returns the final state after folding over the stream.

def jsonlFoldZIO[S, O : JsonCodec](s: S)(f: (S, O) => Task[S]): Unit

Parse a JSONL stream and fold it over a state.

Parse a JSONL stream and fold it over a state.

Type parameters

O

the type of the parsed object, which must have a JsonCodec instance available.

S

the type of the state to fold over the stream

Value parameters

f

function to apply

s

initial state to fold over the stream

Attributes

Returns

a ZIO that returns the final state after folding over the stream.

def jsonlFoldZIO[S, O : JsonCodec](uri: Uri, s: S)(f: (S, O) => Task[S]): Unit

Parse a JSONL stream from a URI (different from origin) and fold it over a state.

Parse a JSONL stream from a URI (different from origin) and fold it over a state.

Type parameters

O

the type of the parsed object, which must have a JsonCodec instance available.

S

the type of the state to fold over the stream

Value parameters

f

function to apply

s

initial state to fold over the stream

uri

the URI to run the request on

Attributes

Returns

a ZIO that returns the final state after folding over the stream.

def jsonlZIO[O : JsonCodec](f: O => Task[Unit]): Unit

Parse a JSONL stream as a stream of O and apply a function to each one to Task[Unit].

Parse a JSONL stream as a stream of O and apply a function to each one to Task[Unit].

Simply ignores the JSON parsing errors.

Type parameters

O

the type of the parsed object, which must have a JsonCodec instance available.

Value parameters

f

function to apply

Attributes

def jsonlZIO[O : JsonCodec](uri: Uri)(f: O => Task[Unit]): Unit

Parse a JSONL stream from a URI (different from origin) as a stream of O and apply a function to each one to Task[Unit].

Parse a JSONL stream from a URI (different from origin) as a stream of O and apply a function to each one to Task[Unit].

Simply ignores the JSON parsing errors.

Type parameters

O

the type of the parsed object, which must have a JsonCodec instance available.

Value parameters

f

function to apply

Attributes