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: 0

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))
}
Output:

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