Documentation ¶
Index ¶
- Constants
- Variables
- func AddMissingPort(addr string, isTLS bool) string
- func Assert(guard bool, text string)
- func CaseInsensitiveCompare(a, b []byte) bool
- func CleanPath(p string) string
- func CopyBuffer(dst network.Writer, src io.Reader, buf []byte) (written int64, err error)
- func CopyZeroAlloc(w network.Writer, r io.Reader) (int64, error)
- func FilterContentType(content string) string
- func IsTrueString(str string) bool
- func LocalIP() string
- func NameOfFunction(f interface{}) string
- func NewNetAddr(network, address string) net.Addr
- func NextLine(b []byte) ([]byte, []byte, error)
- func NormalizeHeaderKey(b []byte, disableNormalizing bool)
- func ParseChunkSize(r network.Reader) (int, error)
- func SkipCRLF(reader network.Reader) error
- func TLSRecordHeaderLooksLikeHTTP(hdr [5]byte) bool
- type H
- type NetAddr
Constants ¶
View Source
const (
UNKNOWN_IP_ADDR = "-"
)
Variables ¶
View Source
var CopyBufPool = sync.Pool{ New: func() interface{} { return make([]byte, 4096) }, }
Functions ¶
func AddMissingPort ¶
AddMissingPort adds a port to a host if it is missing. A literal IPv6 address in hostport must be enclosed in square brackets, as in "[::1]:80", "[::1%lo0]:80".
func CaseInsensitiveCompare ¶
func CleanPath ¶
CleanPath is the URL version of path.Clean, it returns a canonical URL path for p, eliminating . and .. elements.
The following rules are applied iteratively until no further processing can be done:
- Replace multiple slashes with a single slash.
- Eliminate each . path name element (the current directory).
- Eliminate each inner .. path name element (the parent directory) along with the non-.. element that precedes it.
- Eliminate .. elements that begin a rooted path: that is, replace "/.." by "/" at the beginning of a path.
If the result of this process is an empty string, "/" is returned
func CopyBuffer ¶
func FilterContentType ¶ added in v0.7.0
func IsTrueString ¶
func NameOfFunction ¶
func NameOfFunction(f interface{}) string
func NewNetAddr ¶ added in v0.3.0
NewNetAddr creates a new NetAddr object with the network and address provided.
func NormalizeHeaderKey ¶
func TLSRecordHeaderLooksLikeHTTP ¶
TLSRecordHeaderLooksLikeHTTP reports whether a TLS record header looks like it might've been a misdirected plaintext HTTP request.
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.