caddymodule

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequiredLiveURL   = errors.New("live URL is required")
	ErrRequiredShadowURL = errors.New("shadow URL is required")
)

Functions

This section is empty.

Types

type HTTPClientOptions added in v1.6.0

type HTTPClientOptions struct {
	RawMaxIdleConns        *string `json:"max_idle_conns,omitempty"`
	RawMaxIdleConnsPerHost *string `json:"max_idle_conns_per_host,omitempty"`
	RawMaxConnsPerHost     *string `json:"max_conns_per_host,omitempty"`
	RawIdleConnTimeout     *string `json:"idle_conn_timeout,omitempty"`
}

HTTPClientOptions holds the raw, unparsed outbound connection-pool directives from the http_client block. Values are parsed and validated in buildHTTPClientConfig; a value of 0 follows net/http semantics (no limit, or no timeout for idle_conn_timeout).

type MrokiGate

type MrokiGate struct {
	// Required
	RawLive   string `json:"live,omitempty"`
	RawShadow string `json:"shadow,omitempty"`

	// Proxy options
	SamplingRate     *string `json:"sampling_rate,omitempty"`
	RawLiveTimeout   *string `json:"live_timeout,omitempty"`
	RawShadowTimeout *string `json:"shadow_timeout,omitempty"`
	RawMaxBodySize   *string `json:"max_body_size,omitempty"`
	RawShadowRules   *string `json:"shadow_rules,omitempty"`

	// RawMaxConcurrentCallbacks bounds concurrent background callback
	// goroutines (0 = unbounded). A nil pointer means the module default
	// (defaultMaxConcurrentCallbacks) applies.
	RawMaxConcurrentCallbacks *string `json:"max_concurrent_callbacks,omitempty"`

	// Outbound HTTP client connection-pool tuning (optional). Grouped under the
	// http_client block to mirror the proxy binary's MROKI_APP_HTTP_CLIENT_*
	// env namespace. A nil pointer means the module defaults apply.
	HTTPClient *HTTPClientOptions `json:"http_client,omitempty"`

	// Diff options
	DiffIgnoredFields  *string `json:"diff_ignored_fields,omitempty"`
	DiffIncludedFields *string `json:"diff_included_fields,omitempty"`
	DiffFloatTolerance *string `json:"diff_float_tolerance,omitempty"`
	DiffSortArrays     *string `json:"diff_sort_arrays,omitempty"`

	// Redaction options
	RedactedFields *string `json:"redacted_fields,omitempty"`
	// contains filtered or unexported fields
}

func (MrokiGate) CaddyModule

func (MrokiGate) CaddyModule() caddy.ModuleInfo

func (*MrokiGate) Provision

func (m *MrokiGate) Provision(ctx caddy.Context) error

func (MrokiGate) ServeHTTP

ServeHTTP is a terminating handler — it writes the full live response via proxy.ServeHTTP, then fires shadow async. next is intentionally not called because the response is already written.

func (*MrokiGate) UnmarshalCaddyfile

func (m *MrokiGate) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile parses the Caddyfile tokens into the MrokiGate struct. It expects the following format:

mroki_gate {
    live                 <url>
    shadow               <url>
    [sampling_rate       <float>]
    [live_timeout        <duration>]
    [shadow_timeout      <duration>]
    [max_body_size       <bytes>]
    [shadow_rules        <comma-separated ACTION METHOD:path>]
    [max_concurrent_callbacks <int>]
    [http_client {
        [max_idle_conns          <int>]
        [max_idle_conns_per_host <int>]
        [max_conns_per_host      <int>]
        [idle_conn_timeout       <duration>]
    }]
    [diff_ignored_fields  <comma-separated>]
    [diff_included_fields <comma-separated>]
    [diff_float_tolerance <float>]
    [diff_sort_arrays     <bool>]
    [redacted_fields      <comma-separated>]
}

func (*MrokiGate) Validate

func (m *MrokiGate) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL