httputil

package
v2.0.8+incompatible Latest Latest
Warning

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

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

Documentation

Overview

Package httputil implements common HTTP functionality used throughout the Clair codebase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientAddr

func GetClientAddr(r *http.Request) string

GetClientAddr returns the first value in X-Forwarded-For if it exists otherwise fall back to use RemoteAddr

func GetWithUserAgent

func GetWithUserAgent(url string) (*http.Response, error)

GetWithUserAgent performs an HTTP GET with the proper Clair User-Agent.

func Status2xx

func Status2xx(resp *http.Response) bool

Status2xx returns true if the response's status code is success (2xx)

Types

This section is empty.

Jump to

Keyboard shortcuts

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