HTTP server with WebSockets.
All checks were successful
Linting and tests / Linting (push) Successful in 5s
All checks were successful
Linting and tests / Linting (push) Successful in 5s
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user