Configuration

class Configuration : ConditionsHolderBuilder

Configuration builder for Compression feature

Constructors

<init>

Configuration()

Configuration builder for Compression feature

Properties

conditions

Preconditions applied to every response object to check if it should be compressed

encoders

Encoders map by names

Functions

build

fun build(): CompressionOptions

Builds CompressionOptions

default

fun default(): Unit

Appends default configuration

encoder

fun encoder(
    name: String,
    encoder: CompressionEncoder,
    block: CompressionEncoderBuilder.() -> Unit = {}
): Unit

Appends an encoder to the configuration

Extension Functions

deflate

fun Configuration.deflate(
    block: CompressionEncoderBuilder.() -> Unit = {}
): Unit

Appends deflate encoder with default priority of 0.9

gzip

fun Configuration.gzip(
    block: CompressionEncoderBuilder.() -> Unit = {}
): Unit

Appends gzip encoder

identity

fun Configuration.identity(
    block: CompressionEncoderBuilder.() -> Unit = {}
): Unit

Appends identity encoder