utils

package
v0.3.24 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const BufferSize = 1024 * 32
View Source
const CloseFileTimeout = time.Second * 2

Variables

View Source
var ProxyHeadersRegexp, _ = regexp.Compile("^(?i)proxy-")

Functions

func CloseFile

func CloseFile(closer io.Closer)

func GetRequestHostname

func GetRequestHostname(req *http.Request) string

func LookupIp

func LookupIp(host string) (ipV4 net.IP, ipV6 net.IP, err error)

func OpenOrCreateFile added in v0.3.10

func OpenOrCreateFile(filename string) (*os.File, error)

func ProxyBasicAuth

func ProxyBasicAuth(req *http.Request) (username, password string, ok bool)

func RemoveProxyHeaders

func RemoveProxyHeaders(req *http.Request)

func Transfer

func Transfer(readTimeout time.Duration, writeTimeout time.Duration, src io.ReadCloser, dst io.WriteCloser)

func UnescapeString added in v0.3.17

func UnescapeString(s string) string

* unescaped chars: 1. \a, \b, \f, \n, \r, \t, \v, \\ 2. \x00, \u0000, \U00000000 3. \012, \128, ...

Types

This section is empty.

Jump to

Keyboard shortcuts

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