header

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package header 用于指定输出的报头

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	// contains filtered or unexported fields
}

Header 修正报头输出内容

func New

func New(headers map[string]string, funcs func(http.Header)) *Header

New 声明一个用于输出报头的中间件

如果 funcs 不为空,则 funcs 与 headers 相同的内容, 以 funcs 为最终内容。

func (*Header) Delete

func (h *Header) Delete(name string) *Header

Delete 删除指定的报头

func (*Header) Middleware

func (h *Header) Middleware(next http.Handler) http.Handler

Middleware 将当前中间件应用于 next

func (*Header) MiddlewareFunc

func (h *Header) MiddlewareFunc(next func(w http.ResponseWriter, r *http.Request)) http.Handler

MiddlewareFunc 将当前中间件应用于 next

func (*Header) Set

func (h *Header) Set(name, value string) *Header

Set 添加或是修改报头

Jump to

Keyboard shortcuts

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