Skip to main content Link Search Menu Expand Document (external link)

MobyPlatforms.ts overview

Http client layers for all platforms.

Since v1.0.0


Exports Grouped by Category


Browser

makeWebHttpClientLayer

Given the moby connection options, it will construct a layer that provides a http client that you could use to connect to your moby instance.

This function will dynamically import the @effect/platform-browser package.

Signature

declare const makeWebHttpClientLayer: (
  connectionOptions: MobyConnection.HttpConnectionOptionsTagged | MobyConnection.HttpsConnectionOptionsTagged
) => Layer.Layer<HttpClient.HttpClient | Socket.WebSocketConstructor, never, never>

Source

Since v1.0.0

Connection

makeAgnosticHttpClientLayer

Given the moby connection options, it will construct a layer that provides a http client that you could use to connect to your moby instance.

Signature

declare const makeAgnosticHttpClientLayer: (
  connectionOptions: MobyConnection.MobyConnectionOptions
) => Layer.Layer<
  HttpClient.HttpClient | Socket.WebSocketConstructor,
  never,
  HttpClient.HttpClient | Socket.WebSocketConstructor
>

Source

Since v1.0.0

makeBunHttpClientLayer

Given the moby connection options, it will construct a layer that provides a http client that you could use to connect to your moby instance. This is no different than the Node implementation currently.

This function will dynamically import the @effect/platform-node package.

Signature

declare const makeBunHttpClientLayer: (
  connectionOptions: MobyConnection.MobyConnectionOptions
) => Layer.Layer<HttpClient.HttpClient | Socket.WebSocketConstructor, never, never>

Source

Since v1.0.0

Deno

makeDenoHttpClientLayer

Given the moby connection options, it will construct a layer that provides a http client that you could use to connect to your moby instance. This is no different than the Node implementation currently.

This function will dynamically import the @effect/platform-node package.

FIXME: https://github.com/denoland/deno/issues/21436?

Signature

declare const makeDenoHttpClientLayer: (
  connectionOptions: MobyConnection.MobyConnectionOptions
) => Layer.Layer<HttpClient.HttpClient | Socket.WebSocketConstructor, never, never>

Source

Since v1.0.0

Fetch

makeFetchHttpClientLayer

Given the moby connection options, it will construct a layer that provides a http client that you could use to connect to your moby instance. By only supporting http and https connection options, this function does not rely on any specific platform package and uses the @effect/platform/FetchHttpClient as its base http layer.

Signature

declare const makeFetchHttpClientLayer: (
  connectionOptions: MobyConnection.HttpConnectionOptionsTagged | MobyConnection.HttpsConnectionOptionsTagged
) => Layer.Layer<HttpClient.HttpClient | Socket.WebSocketConstructor, never, never>

Source

Since v1.0.0

NodeJS

makeNodeHttpClientLayer

Given the moby connection options, it will construct a layer that provides a http client that you could use to connect to your moby instance.

This function will dynamically import the @effect/platform-node package.

Signature

declare const makeNodeHttpClientLayer: (
  connectionOptions: MobyConnection.MobyConnectionOptions
) => Layer.Layer<HttpClient.HttpClient | Socket.WebSocketConstructor, never, never>

Source

Since v1.0.0

Undici

makeUndiciHttpClientLayer

Given the moby connection options, it will construct a layer that provides a http client that you could use to connect to your moby instance.

This function will dynamically import the @effect/platform-node and undici packages.

Signature

declare const makeUndiciHttpClientLayer: (
  connectionOptions: MobyConnection.MobyConnectionOptions
) => Layer.Layer<HttpClient.HttpClient | Socket.WebSocketConstructor, never, never>

Source

Since v1.0.0