Documentation
¶
Index ¶
Constants ¶
View Source
const ( HeaderContentType = "Content-Type" ContentTypeJson = "application/json" )
Variables ¶
View Source
var Module = fx.Module("xhttp", fx.Supply( NewServerConfig(), ), fx.Invoke(Run), )
Functions ¶
func MiddlewareZerolog ¶
MiddlewareZerolog zerolog logging middleware
func RespondJSON ¶
func RespondJSON(w http.ResponseWriter, val any)
func RunServer ¶
func RunServer(cfg *ServerConfig, mux chi.Router)
startHTTPServer запускает HTTP-сервер.
Types ¶
type ServerConfig ¶
type ServerConfig struct {
Addr string `json:"addr"`
}
func NewServerConfig ¶
func NewServerConfig() *ServerConfig
Click to show internal directories.
Click to hide internal directories.