package api

import "github.com/google/martian/v3/api"

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

Index

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.

Source Files

forwarder.go

Version
v3.3.3 (latest)
Published
Aug 16, 2022
Platform
linux/amd64
Imports
4 packages
Last checked
6 hours ago

Tools for package owners.