mediator

package
v0.0.0-...-35baba4 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package mediator impolements a mediation between the client and server that results in either serving a file or passing the request on to a backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Begin

func Begin(cfg *config.ServerConfig)

Begin sets up and a Mediator and starts a http.Server listening on the given configuration's TLSPort

Types

type Mediator

type Mediator struct {
	// ServerConfig is the configuration this mediator is expected to respect.
	ServerConfig *config.ServerConfig
}

Mediator is responsible for mediating a request, either dispatching it to a backend or handling it as a file request.

func (Mediator) ServeHTTP

func (med Mediator) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP selects the correct backend to hand off to, or serves a file request if there is no matching backend.

Jump to

Keyboard shortcuts

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