CompressionEncoderBuilder

class CompressionEncoderBuilder : ConditionsHolderBuilder

Builder for compression encoder configuration

Properties

conditions

List of conditions for this encoder

encoder

val encoder: CompressionEncoder

instance

name

val name: String

of encoder

priority

var priority: Double

Priority for this encoder

Functions

build

Builds CompressionEncoderConfig instance

Extension Functions

condition

fun ConditionsHolderBuilder.condition(
    predicate: ApplicationCall.(OutgoingContent) -> Boolean
): Unit

Appends a custom condition to the encoder or Compression configuration. A predicate returns true when a response need to be compressed. If at least one condition is not met then the response compression is skipped.

excludeContentType

fun ConditionsHolderBuilder.excludeContentType(
    vararg mimeTypes: ContentType
): Unit

Appends a content type exclusion condition to the encoder or Compression configuration

matchContentType

fun ConditionsHolderBuilder.matchContentType(
    vararg mimeTypes: ContentType
): Unit

Appends a content type condition to the encoder or Compression configuration

minimumSize

fun ConditionsHolderBuilder.minimumSize(minSize: Long): Unit

Appends a minimum size condition to the encoder or Compression configuration