HTTP server with WebSockets.
All checks were successful
Linting and tests / Linting (push) Successful in 5s

This commit is contained in:
2025-09-20 09:59:09 +05:00
parent cc5d010204
commit f1617efb0f
6 changed files with 71 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ package core
import (
"errors"
"net/http"
)
// ServiceNameHTTPServer is a name for HTTP server service.
@@ -11,6 +12,12 @@ const ServiceNameHTTPServer = "core/http_server"
var ErrHTTPServerIsInvalid = errors.New("HTTP server service implementation is invalid")
// HTTPServer is an interface for HTTP server service.
//
//nolint:iface
type HTTPServer interface{}
type HTTPServer interface {
// RegisterHandler registers HTTP handler.
RegisterHandler(method, path string, handler http.HandlerFunc)
// RegisterMiddleware registers HTTP server middlewares.
RegisterMiddleware(middleware HTTPMiddlewareFunc)
}
// HTTPMiddlewareFunc is a function that acts as middleware for HTTP requests.
type HTTPMiddlewareFunc func(fn http.HandlerFunc) http.HandlerFunc