RecordSelector

public struct RecordSelector

A RecordSelector defines a selection of a Record object. It is used in the Configuration.recordSelector to define a subset of Records that should be handled by a Cauli instance.

  • Creates a new RecordSelector.

    Declaration

    Swift

    public init(selects: @escaping (Record) -> (Bool))

    Parameters

    selects

    A closure describing if a Record should be selected or not.

  • Selects every Record.

    Declaration

    Swift

    static func all() -> RecordSelector

    Return Value

    Returns a RecordSelector where every Record is selected.

  • Selects Records by a maximum filesize

    Declaration

    Swift

    static func max(bytesize: Int) -> RecordSelector

    Parameters

    bytesize

    The maximum size in bytes of the Response body.

    Return Value

    Returns a RecordSelector that selects only the Records where the body is smaller or equal than the required size.