caddymodule

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 16 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 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"`

	// Diff options
	DiffIgnoredFields  *string `json:"diff_ignored_fields,omitempty"`
	DiffIncludedFields *string `json:"diff_included_fields,omitempty"`
	DiffFloatTolerance *string `json:"diff_float_tolerance,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>]
    [diff_ignored_fields  <comma-separated>]
    [diff_included_fields <comma-separated>]
    [diff_float_tolerance <float>]
}

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