Documentation
¶
Index ¶
- func CompressWithGzip(data io.Reader) (io.ReadCloser, error)
- func GetBadge(code string) ([]byte, error)
- func Match(pattern, str string) bool
- func ParseClientIP(r *http.Request) string
- func ParseHostname(s string) string
- func ParseInt(s string, fallback int) int
- func ParsePathname(s string) string
- func WriteBadgeBeacon(w http.ResponseWriter, trackingStatus, code string)
- func WriteGifBeacon(w http.ResponseWriter, trackingStatus string)
- type ReadWaitCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressWithGzip ¶ added in v1.1.0
func CompressWithGzip(data io.Reader) (io.ReadCloser, error)
CompressWithGzip takes an io.Reader as input and pipes it through a gzip.Writer returning an io.Reader containing the gzipped data. An error is returned if passing data to the gzip.Writer fails
func Match ¶ added in v1.2.0
Match finds whether the string matches the pattern. Supports '*' and '?' wildcards in the pattern string.
func ParseClientIP ¶
ParseClientIP extract client IP from HTTP request
func ParseInt ¶ added in v1.2.0
ParseIntWithFallback convert string to int and use the fallback if impossible
func ParsePathname ¶
ParsePathname extract path with leading slash
func WriteBadgeBeacon ¶
func WriteBadgeBeacon(w http.ResponseWriter, trackingStatus, code string)
WriteBadgeBeacon write SVG badge beacon in HTTP response
func WriteGifBeacon ¶
func WriteGifBeacon(w http.ResponseWriter, trackingStatus string)
WriteGifBeacon write GIF beacon in HTTP response
Types ¶
type ReadWaitCloser ¶ added in v1.1.0
type ReadWaitCloser struct {
// contains filtered or unexported fields
}
ReadWaitCloser structure
Click to show internal directories.
Click to hide internal directories.