Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiLog ¶
type ApiLog struct { StartTime time.Time `json:"start_time"` EndTime time.Time `json:"end_time"` DurMs int64 `json:"duration_ms"` // duration in milliseconds Type string `json:"type"` // incoming-api or outgoing-api Method string `json:"method"` Address string `json:"address"` // server address for incoming and outgoing Path string `json:"path"` ResponseCode int `json:"response_code"` RequestID string `json:"request_id"` InitialAuthUsername string `json:"initial_auth_username,omitempty"` InitialAuthType string `json:"initial_auth_type,omitempty"` AccountID int64 `json:"account_id,omitempty"` ProviderID int64 `json:"provider_id,omitempty"` UserID int64 `json:"user_id,omitempty"` Username string `json:"username,omitempty"` SourceIP string `json:"source_ip,omitempty"` // only logged for incoming API UserAgent string `json:"user_agent,omitempty"` // only for incoming, indicate type of browser when UI Request ApiLogRequest `json:"request"` Response ApiLogResponse `json:"response"` }
ApiLog is the SQS event details struct encoded as JSON document, sent to SQS, to be logged for each API handler executed.
func GenerateIncomingAPILog ¶
func GenerateIncomingAPILog(startTime time.Time, requestID *string, claim map[string]interface{}, req events.APIGatewayProxyRequest, res events.APIGatewayProxyResponse) ApiLog
type ApiLogRequest ¶
type ApiLogRequest struct { Headers map[string]string `json:"headers,omitempty" search:"flattened"` QueryParameters map[string]string `json:"query_parameters,omitempty" search:"flattened"` BodySize int `json:"body_size" search:"long"` // set even when body is truncated/omitted Body string `json:"body,omitempty"` // json body as a string }
Click to show internal directories.
Click to hide internal directories.