Documentation
¶
Index ¶
- Variables
- func GetLoggerFromContext(ctx *gin.Context) *log.Entry
- func SetCors(router *gin.Engine, allowedOrigins []string)
- type ContextKey
- type HttpServer
- func (hs *HttpServer) CreateLoggerForRequest(ctx *gin.Context)
- func (hs *HttpServer) CreateMetricsForRequest(ctx *gin.Context)
- func (hs *HttpServer) GetCorrelationID(ctx *gin.Context) string
- func (gs *HttpServer) GetPath(ctx *gin.Context) string
- func (gs *HttpServer) LogRequest(c *gin.Context)
- func (gs *HttpServer) MapHttpStatusToLoggingLevel(ctx *gin.Context) logrus.Level
- func (gs *HttpServer) ProfileNextRequest(ctx *gin.Context) time.Duration
- func (hs *HttpServer) Reply(ctx *gin.Context, body interface{})
- func (hs *HttpServer) ReplyWithError(ctx *gin.Context, err error)
- func (hs *HttpServer) RequireCorrelationID(ctx *gin.Context)
- func (hs *HttpServer) RequireRequestID(ctx *gin.Context)
- func (gs *HttpServer) Run() error
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var HeaderXCorrelationId = "X-Correlation-ID"
View Source
var HeaderXRequestId = "X-Request-ID"
Functions ¶
Types ¶
type ContextKey ¶
type ContextKey struct {
// contains filtered or unexported fields
}
func (ContextKey) String ¶
func (ck ContextKey) String() string
type HttpServer ¶
func NewHttpServer ¶
func NewHttpServer(config *domain.HttpServerConfig) *HttpServer
func (*HttpServer) CreateLoggerForRequest ¶ added in v0.2.0
func (hs *HttpServer) CreateLoggerForRequest(ctx *gin.Context)
func (*HttpServer) CreateMetricsForRequest ¶ added in v0.2.0
func (hs *HttpServer) CreateMetricsForRequest(ctx *gin.Context)
func (*HttpServer) GetCorrelationID ¶
func (hs *HttpServer) GetCorrelationID(ctx *gin.Context) string
func (*HttpServer) LogRequest ¶ added in v0.2.0
func (gs *HttpServer) LogRequest(c *gin.Context)
func (*HttpServer) MapHttpStatusToLoggingLevel ¶
func (gs *HttpServer) MapHttpStatusToLoggingLevel(ctx *gin.Context) logrus.Level
func (*HttpServer) ProfileNextRequest ¶
func (gs *HttpServer) ProfileNextRequest(ctx *gin.Context) time.Duration
func (*HttpServer) Reply ¶
func (hs *HttpServer) Reply(ctx *gin.Context, body interface{})
func (*HttpServer) ReplyWithError ¶
func (hs *HttpServer) ReplyWithError(ctx *gin.Context, err error)
func (*HttpServer) RequireCorrelationID ¶
func (hs *HttpServer) RequireCorrelationID(ctx *gin.Context)
func (*HttpServer) RequireRequestID ¶
func (hs *HttpServer) RequireRequestID(ctx *gin.Context)
func (*HttpServer) Run ¶
func (gs *HttpServer) Run() error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.