xhttp

package
v0.0.0-...-c6a8645 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: MIT Imports: 11 Imported by: 0

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

func MiddlewareZerolog(next http.Handler) http.Handler

MiddlewareZerolog zerolog logging middleware

func RespondJSON

func RespondJSON(w http.ResponseWriter, val any)

func Run

func Run(lc fx.Lifecycle, mux chi.Router, cfg *ServerConfig)

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

Jump to

Keyboard shortcuts

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