ctx

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReqId

func GetReqId(c context.Context) string

GetReqId extract request id from given context. This is a shortcut for Get with ReqId to get the request id from given context.

func SetFromRequestHeader

func SetFromRequestHeader(c http.Context)

SetFromRequestHeader set any available metadata from given http context in the request header.

Types

type Metadata

type Metadata struct {
	Authorization   string
	UserAgent       string
	CacheControl    string
	ForwardedFor    string
	RequestFrom     string
	DeviceId        string
	App             string
	VersionApp      string
	ReqId           string
	ReqTags         string
	ReqUser         string
	ReqNama         string
	ReqKodeJabatan  string
	ReqNamaJabatan  string
	ReqKodeUker     string
	ReqNamaUker     string
	ReqJenisUker    string
	ReqKodeMainUker string
	ReqKodeRegion   string
	PathGateway     string
	ApiKey          string
	UrlPath         string // UrlPath may contain the url path information coming from http request
	SignaturePath   string // SignaturePath may contain the signature command from artisan command
}

Metadata holds any request-scoped shared data within brispot microservice.

func Get added in v0.5.0

func Get(ctx context.Context) Metadata

Get retrieve Metadata from given context with key from this pkg.

Jump to

Keyboard shortcuts

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