requestid

package
v6.0.0-beta.11 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package requestid x-request-id 的中间件

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx *web.Context) string

Get 从 [server.Context] 中获取 request id 值

func New

func New(key string, gen Gen) web.Middleware

New 声明 request id 的中间件

key 表示报头名称,如果为空,则采用 x-request-id; gen 为生成 id 的方法,可以为空,采用默认值;

Types

type Gen

type Gen func() string

Gen 生成唯一 ID 的方法

Jump to

Keyboard shortcuts

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