...

Package requestid

import "github.com/gin-contrib/requestid"
Overview
Index

Overview ▾

func Get

func Get(c *gin.Context) string

Get returns the request identifier

func New

func New(opts ...Option) gin.HandlerFunc

New initializes the RequestID middleware.

type Generator

type Generator func() string

type Handler

type Handler func(c *gin.Context, requestID string)

type HeaderStrKey

type HeaderStrKey string

type Option

Option for queue system

type Option func(*config)

func WithCustomHeaderStrKey

func WithCustomHeaderStrKey(s HeaderStrKey) Option

WithCustomeHeaderStrKey set custom header key for request id

func WithGenerator

func WithGenerator(g Generator) Option

WithGenerator set generator function

func WithHandler

func WithHandler(handler Handler) Option

WithHandler set handler function for request id with context