nocache

package module
v0.0.0-...-243a297 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2015 License: MIT Imports: 4 Imported by: 0

README

negroni middleware for nocache

Negroni middleware for no cache http headers

Usage

package main

import (
    "fmt"
    "github.com/codegangsta/negroni"
    "github.com/rabeesh/negroni-nocache"
    "net/http"
)


func main() {
    mux := http.NewServeMux()
    mux.HandleFunc("/", func(rw http.ResponseWriter, req *http.Request) {
        fmt.Fprintf(rw, "Welcome to the home page!")
    })

    n := negroni.New()
    n.Use(nocache.New(true))
    n.Use(negroni.NewStatic(http.Dir("public")))
    n.UseHandler(mux)
    n.Run(":5000")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoCache

type NoCache struct {
	Logger *log.Logger
	// contains filtered or unexported fields
}

func New

func New(noEtag bool) *NoCache

func (*NoCache) ServeHTTP

func (c *NoCache) ServeHTTP(rw http.ResponseWriter, req *http.Request, next http.HandlerFunc)

Jump to

Keyboard shortcuts

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