session

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RequestIDSessionKey request id session context key
	RequestIDSessionKey = "REQUEST_ID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestID

type RequestID uint32

RequestID of a session.

func NewRequestID

func NewRequestID() RequestID

NewRequestID generates a new ID. The generated ID is high likely to be unique, but not cryptographically secure. The generated ID will never be 0.

func RequestIDFromContext

func RequestIDFromContext(c *gin.Context) RequestID

RequestIDFromContext returns ID in this context, or 0 if not contained.

func (RequestID) ToString

func (id RequestID) ToString() string

ToString returns the string form of ID

func (RequestID) ToUint32

func (id RequestID) ToUint32() uint32

ToUint32 returns the uint32 form of ID

Jump to

Keyboard shortcuts

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