ConditionsHolderBuilder

interface ConditionsHolderBuilder

Represents a builder for conditions

Properties

conditions

abstract val conditions: MutableList<ApplicationCall.(OutgoingContent) -> Boolean>

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

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

Inheritors

CompressionEncoderBuilder

class CompressionEncoderBuilder : ConditionsHolderBuilder

Builder for compression encoder configuration

Configuration

class Configuration : ConditionsHolderBuilder

Configuration builder for Compression feature