context

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvancedResponseWriter

type AdvancedResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

AdvancedResponseWriter provide method to write response and effective ways to get response with more details

func NewAdvancedResponseWriter

func NewAdvancedResponseWriter(w http.ResponseWriter) *AdvancedResponseWriter

func (AdvancedResponseWriter) Status

func (h AdvancedResponseWriter) Status() int

func (*AdvancedResponseWriter) WriteHeader

func (h *AdvancedResponseWriter) WriteHeader(code int)

type RequestAttributes

type RequestAttributes struct {
	ServiceCode        string             `json:"service_code"`
	StatusCode         int                `json:"status"`
	ExecutionTime      time.Duration      `json:"duration_ms"`
	Uri                string             `json:"uri"`
	Query              string             `json:"query"`
	Mapping            string             `json:"mapping"`
	Url                string             `json:"url"`
	Method             string             `json:"method"`
	CallerId           string             `json:"caller_id"`
	DeviceId           string             `json:"device_id"`
	DeviceSessionId    string             `json:"device_session_id"`
	CorrelationId      string             `json:"correlation_id"`
	ClientIpAddress    string             `json:"client_ip_address"`
	UserAgent          string             `json:"user_agent"`
	SecurityAttributes SecurityAttributes `json:"security_attributes"`
}

func GetOrCreateRequestAttributes

func GetOrCreateRequestAttributes(r *http.Request) *RequestAttributes

func GetRequestAttributes

func GetRequestAttributes(ctx context.Context) *RequestAttributes

type SecurityAttributes

type SecurityAttributes struct {
	UserId            string `json:"user_id"`
	TechnicalUsername string `json:"technical_username"`
}

type WrappingResponseWriter

type WrappingResponseWriter interface {
	Writer() http.ResponseWriter
}

Jump to

Keyboard shortcuts

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