api

package
v3.3.10 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package api contains a forwarder to route system HTTP requests to the local API server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Forwarder

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

Forwarder is a request modifier that routes the request to the API server and marks the request for skipped logging.

func NewForwarder

func NewForwarder(host string, port int) *Forwarder

NewForwarder returns a Forwarder that rewrites requests to host.

func (*Forwarder) ModifyRequest

func (f *Forwarder) ModifyRequest(req *http.Request) error

ModifyRequest forwards the request to the local API server running at f.port, downgrades the scheme to http and marks the request context for skipped logging. API requests are marked for skipping the roundtrip.

Jump to

Keyboard shortcuts

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