Help us shape the future of Go! Take the 2026 Go Developer Survey

util

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomizeValidationError added in v0.7.0

func CustomizeValidationError(err error) error

func LogRequest

func LogRequest(auditLogDto *AuditLoggerDTO)

func SetupCorsOriginHeader added in v0.6.29

func SetupCorsOriginHeader(w *http.ResponseWriter)

Types

type AuditLoggerDTO

type AuditLoggerDTO struct {
	UrlPath         string        `json:"urlPath"`
	UserEmail       string        `json:"userEmail"`
	UpdatedOn       time.Time     `json:"updatedOn"`
	QueryParams     string        `json:"queryParams"`
	ApiResponseCode int           `json:"apiResponseCode"`
	RequestPayload  []byte        `json:"requestPayload"`
	RequestMethod   string        `json:"requestMethod"`
	ResponseTime    time.Duration `json:"responseTime"`
}

type LoggingMiddleware

type LoggingMiddleware interface {
	LoggingMiddleware(next http.Handler) http.Handler
}

type LoggingMiddlewareImpl

type LoggingMiddlewareImpl struct {
	// contains filtered or unexported fields
}

func NewLoggingMiddlewareImpl

func NewLoggingMiddlewareImpl(userService user.UserService) *LoggingMiddlewareImpl

func (LoggingMiddlewareImpl) LoggingMiddleware

func (impl LoggingMiddlewareImpl) LoggingMiddleware(next http.Handler) http.Handler

LoggingMiddleware is a middleware function that logs the incoming request.

Jump to

Keyboard shortcuts

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