etag

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2019 License: Apache-2.0 Imports: 5 Imported by: 1

README

elton-etag

Build Status

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
	})

	e.ListenAndServe(":3000")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) elton.Handler

New create a ETag middleware

func NewDefault

func NewDefault() elton.Handler

NewDefault create a default ETag middleware

Types

type Config

type Config struct {
	Skipper elton.Skipper
}

Config eTag config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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