mirror

package
v2.11.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mirroring

type Mirroring struct {
	// contains filtered or unexported fields
}

Mirroring is an http.Handler that can mirror requests.

func New

func New(handler http.Handler, pool *safe.Pool, maxBodySize int64, hc *dynamic.HealthCheck) *Mirroring

New returns a new instance of *Mirroring.

func (*Mirroring) AddMirror

func (m *Mirroring) AddMirror(handler http.Handler, percent int) error

AddMirror adds an httpHandler to mirror to.

func (*Mirroring) RegisterStatusUpdater added in v2.5.0

func (m *Mirroring) RegisterStatusUpdater(fn func(up bool)) error

RegisterStatusUpdater adds fn to the list of hooks that are run when the status of handler of the Mirroring changes. Not thread safe.

func (*Mirroring) ServeHTTP

func (m *Mirroring) ServeHTTP(rw http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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