Package-level declarations

Types

Link copied to clipboard
internal class AuthenticatedNetworkClient(engine: HttpClientEngine, serverConfigDTO: ServerConfigDTO, bearerAuthProvider: BearerAuthProvider, kaliumLogger: KaliumLogger, installCompression: Boolean = true)

Provides a HttpClient that has all the needed configurations to talk with a Wire backend, like Serialization, and Content Negotiation. It's Authenticated, and will use the provided SessionManager to fill necessary Authentication headers, and refresh tokens as they expire.

Link copied to clipboard
internal class AuthenticatedWebSocketClient(engine: HttpClientEngine, bearerAuthProvider: BearerAuthProvider, serverConfigDTO: ServerConfigDTO, kaliumLogger: KaliumLogger, webSocketSessionProvider: (HttpClient, String) -> WebSocketSession? = null)

HttpClient with WebSocket (ws or wss) capabilities. It's Authenticated, and will use the provided SessionManager to fill necessary Authentication headers, and refresh tokens as they expire.

Link copied to clipboard
Link copied to clipboard
internal class KaliumHttpLogger(level: LogLevel, kaliumLogger: KaliumLogger)
Link copied to clipboard

A client's logging plugin.

Link copied to clipboard
internal class KaliumLoggedContent(originalContent: OutgoingContent, channel: ByteReadChannel) : OutgoingContent.ReadChannelContent
Link copied to clipboard
class KaliumWebSocketFactory(okHttpClient: OkHttpClient) : WebSocket.Factory

Upon request, creates normal WebSocket, but wraps the listener to add logging.

Link copied to clipboard
Link copied to clipboard
internal class UnauthenticatedNetworkClient(engine: HttpClientEngine, backendLinks: ServerConfigDTO)

Provides a HttpClient that has all the needed configurations to talk with a Wire backend, like Serialization, and Content Negotiation.

Link copied to clipboard
internal class UnboundNetworkClient(engine: HttpClientEngine)

Provides a HttpClient that has all the needed configurations to talk with a Wire backend, like Serialization, and Content Negotiation. Unlike others, this one has no strict ties with any API version nor default Base Url

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val SupportedApiVersions: Set<Int>
Link copied to clipboard
internal const val WEBSOCKET_PING_INTERVAL_MILLIS: Long
Link copied to clipboard
internal const val WEBSOCKET_TIMEOUT: Long

Functions

Link copied to clipboard
fun buildOkhttpClient(block: OkHttpClient.Builder.() -> Unit): OkHttpClient
fun buildOkhttpClient(block: OkHttpClient.Builder.() -> Unit): OkHttpClient
Link copied to clipboard
actual fun defaultHttpEngine(serverConfigDTOApiProxy: ServerConfigDTO.ApiProxy?, proxyCredentials: ProxyCredentialsDTO?, ignoreSSLCertificates: Boolean, certificatePinning: CertificatePinning, httpTrafficObserver: HttpTrafficObserver?): HttpClientEngine
expect fun defaultHttpEngine(serverConfigDTOApiProxy: ServerConfigDTO.ApiProxy?, proxyCredentials: ProxyCredentialsDTO?, ignoreSSLCertificates: Boolean = false, certificatePinning: CertificatePinning, httpTrafficObserver: HttpTrafficObserver? = null): HttpClientEngine
actual fun defaultHttpEngine(serverConfigDTOApiProxy: ServerConfigDTO.ApiProxy?, proxyCredentials: ProxyCredentialsDTO?, ignoreSSLCertificates: Boolean, certificatePinning: CertificatePinning, httpTrafficObserver: HttpTrafficObserver?): HttpClientEngine
actual fun defaultHttpEngine(serverConfigDTOApiProxy: ServerConfigDTO.ApiProxy?, proxyCredentials: ProxyCredentialsDTO?, ignoreSSLCertificates: Boolean, certificatePinning: CertificatePinning, httpTrafficObserver: HttpTrafficObserver?): HttpClientEngine
Link copied to clipboard
internal fun httpTrafficObserverInterceptor(observer: HttpTrafficObserver): Interceptor

A network interceptor (added via OkHttpClient.Builder.addNetworkInterceptor) that hands the fully-prepared request and raw response - including bodies - to observer, then forwards them unmodified (aside from re-wrapping the response body, which OkHttp requires once its bytes have been read for inspection).

Link copied to clipboard
internal suspend fun OutgoingContent.observe(log: ByteWriteChannel): OutgoingContent
Link copied to clipboard
internal fun provideBaseHttpClient(engine: HttpClientEngine, kaliumLogger: KaliumLogger, installCompression: Boolean = true, config: HttpClientConfig<*>.() -> Unit = {}): HttpClient
Link copied to clipboard
internal fun shouldAddApiVersion(apiVersion: Int): Boolean
Link copied to clipboard
fun supportedConnectionSpecs(): List<ConnectionSpec>