l4subroute

package
v0.0.0-...-ec8fae2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// The primary list of routes to compile and execute.
	Routes layer4.RouteList `json:"routes,omitempty"`

	// Maximum time connections have to complete the matching phase (the first terminal handler is matched). Default: 3s.
	MatchingTimeout caddy.Duration `json:"matching_timeout,omitempty"`
	// contains filtered or unexported fields
}

Handler implements a handler that compiles and executes routes. This is useful for a batch of routes that all inherit the same matchers, or for multiple routes that should be treated as a single route.

func (*Handler) CaddyModule

func (*Handler) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Handler) Handle

func (h *Handler) Handle(cx *layer4.Connection, next layer4.Handler) error

Handle handles the connections.

func (*Handler) Provision

func (h *Handler) Provision(ctx caddy.Context) error

Provision sets up the module.

func (*Handler) UnmarshalCaddyfile

func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile sets up the Handler from Caddyfile tokens. Syntax:

subroute {
	matching_timeout <duration>
	@a <matcher> [<matcher_args>]
	@b {
		<matcher> [<matcher_args>]
		<matcher> [<matcher_args>]
	}
	route @a @b {
		<handler> [<handler_args>]
	}
	@c <matcher> {
		<matcher_option> [<matcher_option_args>]
	}
	route @c {
		<handler> [<handler_args>]
		<handler> {
			<handler_option> [<handler_option_args>]
		}
	}
}

Jump to

Keyboard shortcuts

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