ctx

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReqId

func GetReqId(c http.Context) string

GetReqId shortcut of ParseRequest with ReqId to get request id from given http 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
}

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

func ParseRequest

func ParseRequest(c http.Context) Metadata

ParseRequest return Metadata from given http context but return empty data instead if no data were found.

Jump to

Keyboard shortcuts

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