server

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPServer

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

HTTPServer represents an HTTP server with standard middleware

func NewHTTPServer

func NewHTTPServer(opts Options) (*HTTPServer, error)

NewHTTPServer creates a new HTTP server with standard configuration

func (*HTTPServer) GetRouter

func (s *HTTPServer) GetRouter() *gin.Engine

GetRouter returns the Gin router for additional configuration

func (*HTTPServer) Start

func (s *HTTPServer) Start() error

Start starts the HTTP server

func (*HTTPServer) Stop

func (s *HTTPServer) Stop(ctx context.Context) error

Stop gracefully stops the HTTP server

func (*HTTPServer) WaitForShutdown

func (s *HTTPServer) WaitForShutdown() error

WaitForShutdown waits for interrupt signal and gracefully shuts down

type MiddlewareStack

MiddlewareStack holds the middleware components

type Options

type Options struct {
	Config           *config.BaseConfig
	Logger           logger.Logger
	CustomMiddleware []gin.HandlerFunc
	HealthChecks     []observability.HealthCheck
	Routes           func(*gin.Engine) // Function to setup custom routes

	// OpenTelemetry configuration (optional)
	EnableOpenTelemetry bool
	OTelConfig          *telemetry.OpenTelemetryConfig
}

Options for server configuration

Jump to

Keyboard shortcuts

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