package
module
Version:
v0.1.2
Opens a new window with list of versions in this module.
Published: Jan 1, 2020
License: Apache-2.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
README
¶
elton-etag

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