reverseproxy

package
v0.0.0-...-4109721 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package reverseproxy maintains the reverse proxy handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL    *url.URL
	RProxy *httputil.ReverseProxy
}

Config is the configuration needed to create a reverse proxy.

type Handler

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

func New

func New(logger *slog.Logger, rProxyConfig map[string]Config) *Handler

New constructs a handlers for a route access.

func (*Handler) Forward

func (h *Handler) Forward(apiName string) func(http.ResponseWriter, *http.Request)

Forward returns a function that serves as an HTTP handler to forward incoming requests to a specified ReverseProxy instance.

Jump to

Keyboard shortcuts

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