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: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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