etag

package
v0.0.0-...-fe9ae42 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT, MIT Imports: 9 Imported by: 2

README

etag

HTTP etag support middleware for Go.

Installation

go get -u -d -v github.com/icco/gutil/etag

Documentation

API documentation can be found here: https://godoc.org/github.com/icco/gutil/etag

Usage

package main

import (
  "github.com/icco/gutil/etag"
  "github.com/go-chi/chi/v5"
)

func main() {
  r := chi.NewRouter()
  r.Use(etag.Handler(false))
  r.Get("/", func(w http.ResponseWriter, r *http.Request) {
    w.Write([]byte("welcome"))
  })
  http.ListenAndServe(":3000", r)
}

Documentation

Index

Constants

View Source
const Version = "0.2.1"

Version is this package's version.

Variables

This section is empty.

Functions

func Handler

func Handler(weak bool) func(next http.Handler) 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