package
module
Version:
v0.0.3
Opens a new window with list of versions in this module.
Published: Jun 7, 2019
License: Apache-2.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
cod-etag

ETag middleware for cod, generate response's ETag header by sha1.
package main
import (
"bytes"
"github.com/vicanso/cod"
etag "github.com/vicanso/cod-etag"
)
func main() {
d := cod.New()
d.Use(etag.NewDefault())
d.GET("/", func(c *cod.Context) (err error) {
c.BodyBuffer = bytes.NewBufferString("abcd")
return
})
d.ListenAndServe(":7001")
}
Documentation
¶
New create a ETag middleware
NewDefault create a default ETag middleware
Source Files
¶
Click to show internal directories.
Click to hide internal directories.