Builder

Builder class that provides a fluent API to configure and build a Network instance. Allows the customization of the underlying HTTP client and the coroutine context used within the Network.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
var client: HttpClient

Configurable HTTP client instance used for executing network requests. This property can be customized with a specific implementation of HttpClient or left as the default platform HTTP client.

Link copied to clipboard

The coroutine context used for executing network operations. Defaults to the platform-specific network context if not explicitly set.

Functions

Link copied to clipboard

Constructs and returns an instance of the Network class with the configured properties.

Link copied to clipboard
fun client(client: HttpClient): Tolgee.Config.Network.Builder

Configures the HTTP client to be used in the network builder.

fun client(engine: HttpClientEngine): Tolgee.Config.Network.Builder

Configures the client with the provided HTTP client engine.

fun <T : HttpClientEngineConfig> client(engineFactory: HttpClientEngineFactory<T>): Tolgee.Config.Network.Builder

Configures the HTTP client using the specified engine factory.

fun client(config: HttpClientConfig<*>.() -> Unit): Tolgee.Config.Network.Builder

Configures and creates an instance of HttpClient using the provided configuration block.

fun client(engine: HttpClientEngine, config: HttpClientConfig<*>.() -> Unit): Tolgee.Config.Network.Builder

Configures and creates an HttpClient instance using the provided engine and configuration block.

fun <T : HttpClientEngineConfig> client(engineFactory: HttpClientEngineFactory<T>, config: HttpClientConfig<T>.() -> Unit): Tolgee.Config.Network.Builder

Configures and initializes an HttpClient with the specified engine factory and configuration block.

Link copied to clipboard

Sets the CoroutineContext for the Builder.