l4tee

package
v0.0.0-...-6e5f5e3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 7 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 {
	// Handlers is the list of handlers that constitute this
	// concurrent branch. Any handlers that do connection
	// matching (which involves recording and rewinding the
	// stream) are unsafe to tee, so do all connection
	// matching before teeing.
	HandlersRaw []json.RawMessage `json:"branch,omitempty" caddy:"namespace=layer4.handlers inline_key=handler"`
	// contains filtered or unexported fields
}

Handler is a layer4 handler that replicates a connection so that a branch of handlers can concurrently handle it. Reads happen in lock-step with all concurrent branches to avoid buffering: if one of the branches (including the main handler chain) stops reading from the connection, it will block all branches.

func (*Handler) CaddyModule

func (*Handler) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Handler) Handle

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

Handle handles the connection.

func (*Handler) Provision

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

Provision sets up the handler.

func (*Handler) UnmarshalCaddyfile

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

UnmarshalCaddyfile sets up the Handler from Caddyfile tokens. Syntax:

tee {
	<handler>
	<handler> [<args>]
}

Jump to

Keyboard shortcuts

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