Documentation ¶
Index ¶
- Constants
- Variables
- func ETag(checksum string) string
- func ExtensionsByType(fileName string) string
- func HeaderTimestamp(ts time.Time) string
- func HostMatches(r *http.Request, hosts []string) bool
- func HostOnly(hostname string) string
- func HostSubdomainOf(r *http.Request, hosts []string) bool
- func HostsOnly(hostname []string) []string
- func IsRequestCanceled(r *http.Request) bool
- func IsSuccessStatusCode(response *http.Response) bool
- func RequestScheme(r *http.Request) string
- func ServeHealth() http.Handler
- func ServePPROF(pprofPrefix string) http.Handler
- func SetHealthHandlerInfo(info string)
- type MetricResponseWriter
- type Range
Constants ¶
View Source
const (
// DateHeaderTimestampFormat - Last-Modified: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT
DateHeaderTimestampFormat = "Mon, 02 Jan 2006 15:04:05 GMT"
)
Variables ¶
View Source
var ErrBadRange = errors.New("invalid range")
View Source
var ErrUnsatisfiableRange = errors.New("unsatisfiable range")
Functions ¶
func ExtensionsByType ¶
func HeaderTimestamp ¶
func IsRequestCanceled ¶
func IsSuccessStatusCode ¶
IsSuccessStatusCode returns true for status code 2xx
func RequestScheme ¶
func ServeHealth ¶
func ServePPROF ¶
func SetHealthHandlerInfo ¶
func SetHealthHandlerInfo(info string)
Types ¶
type MetricResponseWriter ¶
type MetricResponseWriter struct { http.ResponseWriter StatusCode int }
func NewMetricResponseWriter ¶
func NewMetricResponseWriter(w http.ResponseWriter) *MetricResponseWriter
func (*MetricResponseWriter) WriteHeader ¶
func (mrw *MetricResponseWriter) WriteHeader(code int)
Click to show internal directories.
Click to hide internal directories.