...

Text file src/github.com/emissary-ingress/emissary/v3/python/ambassador/ir/irbuffer.py

Documentation: github.com/emissary-ingress/emissary/v3/python/ambassador/ir

     1from typing import TYPE_CHECKING
     2
     3from ..config import Config
     4from ..utils import RichStatus
     5from .irfilter import IRFilter
     6
     7if TYPE_CHECKING:
     8    from .ir import IR  # pragma: no cover
     9
    10
    11class IRBuffer(IRFilter):
    12    def __init__(
    13        self,
    14        ir: "IR",
    15        aconf: Config,
    16        rkey: str = "ir.buffer",
    17        name: str = "ir.buffer",
    18        kind: str = "IRBuffer",
    19        **kwargs
    20    ) -> None:
    21
    22        super().__init__(ir=ir, aconf=aconf, rkey=rkey, kind=kind, name=name, **kwargs)
    23
    24    def setup(self, ir: "IR", aconf: Config) -> bool:
    25
    26        max_request_bytes = self.pop("max_request_bytes", None)
    27        if max_request_bytes is not None:
    28            self["max_request_bytes"] = max_request_bytes
    29        else:
    30            self.post_error(RichStatus.fromError("missing required field: max_request_bytes"))
    31            return False
    32
    33        if self.pop("max_request_time", None):
    34            self.ir.aconf.post_notice("'max_request_time' is no longer supported, ignoring", self)
    35
    36        return True

View as plain text