dev.cheleb.ziotapir.laminar

Members list

Type members

Classlikes

trait SecuredContent[UserToken <: WithToken](using session: Session[UserToken])

A trait to define secured content for Laminar applications.

A trait to define secured content 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
object ZButton

A Laminar button that runs a ZIO effect on click.

A Laminar button that runs a ZIO effect on click.

Attributes

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

Extensions

Extensions

extension [A](eventBus: EventBus[A])
def zEmit(value: A): Task[Unit]
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.

Value parameters

uri

The URI to run the request on

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

extension [WI, WO](zio: RIO[BackendClient, Response[ZStream[Any, Throwable, WI] => ZStream[Any, Throwable, WO]]])
def asWebSocketStream(debug: Boolean = ...): RIO[BackendClient, ZStream[Any, Throwable, WI] => ZStream[Any, Throwable, WO]]

Convert the response to a WebSocket stream function.

Convert the response to a WebSocket stream function.

Simply extracts the body from the response, and optionally logs the response for debugging purposes.

Body is a function from ZStream of Input to ZStream of Output.

Value parameters

debug

whether to enable debug logging

Attributes