httpserver

package module
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCorrelationID added in v0.2.2

func GetCorrelationID(ctx *gin.Context) string

func GetLoggerFromGinContext added in v0.2.2

func GetLoggerFromGinContext(ctx *gin.Context) (*log.Entry, error)

func GetRequestID added in v0.2.2

func GetRequestID(ctx *gin.Context) string

Types

type HttpRequestMetric added in v0.2.3

type HttpRequestMetric struct {
	Method   string `metric:"method"`
	Path     string `metric:"path"`
	Status   int    `metric:"status"`
	Duration int64  `metric:"duration"`
}

type HttpServer

type HttpServer struct {
	Gin *gin.Engine
	Env env.Environment
	// contains filtered or unexported fields
}

func NewHttpServer

func NewHttpServer(env env.Environment, config *HttpConfig.HttpServerConfig) (*HttpServer, error)

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 (hs *HttpServer) Run() error

func (*HttpServer) SessionDelete added in v0.2.11

func (hs *HttpServer) SessionDelete(c *gin.Context, key string) error

func (*HttpServer) SessionGet added in v0.2.11

func (hs *HttpServer) SessionGet(c *gin.Context, key string) (interface{}, bool)

func (*HttpServer) SessionSet added in v0.2.11

func (hs *HttpServer) SessionSet(c *gin.Context, key string, value interface{}) error

type InternalServerError added in v0.2.11

type InternalServerError struct {
	AdditionalData interface{}
}

MARK: Internal Server Error

func (*InternalServerError) Error added in v0.2.11

func (e *InternalServerError) Error() string

func (*InternalServerError) RestCode added in v0.2.11

func (e *InternalServerError) RestCode() int

func (*InternalServerError) Unwrap added in v0.2.11

func (e *InternalServerError) Unwrap() error

Directories

Path Synopsis
contract module

Jump to

Keyboard shortcuts

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