etag

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

README

cod-etag

Build Status

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) cod.Handler

New create a ETag middleware

func NewDefault

func NewDefault() cod.Handler

NewDefault create a default ETag middleware

Types

type Config

type Config struct {
	Skipper cod.Skipper
}

Config eTag config

Jump to

Keyboard shortcuts

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