etag

package module
v0.0.0-...-513ea8f Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2016 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

etag

Build Status Coverage Status

HTTP etag support middleware for Go.

Installation

go get -u github.com/go-http-utils/etag

Documentation

API documentation can be found here: https://godoc.org/github.com/go-http-utils/etag

Usage

import (
  "github.com/go-http-utils/etag"
)
mux := http.NewServeMux()
mux.HandleFunc("/", func(res http.ResponseWriter, req *http.Request) {
  res.Write([]byte("Hello World"))
})

http.ListenAndServe(":8080", etag.Handler(mux, false))

Documentation

Overview

Example
package main

import (
	"net/http"

	"github.com/go-http-utils/etag"
)

func main() {
	mux := http.NewServeMux()
	mux.HandleFunc("/", func(res http.ResponseWriter, req *http.Request) {
		res.Write([]byte("Hello World"))
	})

	http.ListenAndServe(":8080", etag.Handler(mux, false))
}

Index

Examples

Constants

View Source
const Version = "0.2.1"

Version is this package's version.

Variables

This section is empty.

Functions

func Handler

func Handler(h http.Handler, weak bool) http.Handler

Handler wraps the http.Handler h with ETag support.

Types

This section is empty.

Jump to

Keyboard shortcuts

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