ctxutils

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PutRequestContextData

func PutRequestContextData(targetCtx context.Context, data *RequestContextData) context.Context

PutRequestContextData puts the request's context data into the target context and returns the new context.

Types

type RequestContextData

type RequestContextData struct {
	ID        string    `json:"id,omitempty"`
	EntryTime time.Time `json:"entry_time,omitempty"`
}

RequestContextData is the schema of a request's context. The request can be any network request.

func GetRequestContextData

func GetRequestContextData(targetCtx context.Context) *RequestContextData

GetRequestContextData extracts the request's context data from the target context and returns it.

Jump to

Keyboard shortcuts

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