handler

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMux added in v1.1.0

func NewMux(apiKey *string, hostOverride *string, healthy *int32, logger *logrus.Logger) *http.ServeMux

NewMux create a new handler

Types

type Client

type Client interface {
	Do(req *http.Request) (*http.Response, error)
}

Client proxy server HTTP client

type Handler

type Handler struct {
	ProxyClient Client
	Logger      *logrus.Logger
	Healthy     *int32
}

Handler proxy server handler

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ProxyClient

type ProxyClient struct {
	Client       Client
	HostOverride string
	Logger       *logrus.Logger
	APIKey       string
}

ProxyClient implements the Client interface

func (*ProxyClient) Do

func (p *ProxyClient) Do(req *http.Request) (*http.Response, error)

Do implement the proxy request handling

Jump to

Keyboard shortcuts

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