xfasthttp

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module("xfasthttp",
	fx.Supply(
		NewServerConfig(),
	),
	fx.Provide(
		NewServer,
		NewLifecycle,
	),
	fx.Invoke(
		RunServer,
	),
)

Functions

func MiddlewarePanicRecovery

func MiddlewarePanicRecovery(next fasthttp.RequestHandler) fasthttp.RequestHandler

мидлвара для отлова паники и логирования через zerolog

func MiddlewareZerolog

func MiddlewareZerolog(next fasthttp.RequestHandler) fasthttp.RequestHandler

FasthttpZerolog — логгирующая мидлвара для fasthttp

func NewServer

func NewServer(handler fasthttp.RequestHandler) *fasthttp.Server

func RunServer

func RunServer(lc fx.Lifecycle, slc *Lifecycle)

Types

type Lifecycle

type Lifecycle struct {
	// contains filtered or unexported fields
}

func NewLifecycle

func NewLifecycle(srv *fasthttp.Server, cfg *ServerConfig) *Lifecycle

func (*Lifecycle) OnStart

func (s *Lifecycle) OnStart(ctx context.Context) error

func (*Lifecycle) OnStop

func (s *Lifecycle) OnStop(ctx context.Context) error

type ServerConfig

type ServerConfig struct {
	Addr string
}

func NewServerConfig

func NewServerConfig() *ServerConfig

Jump to

Keyboard shortcuts

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