server

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig added in v1.1.0

type AuthConfig struct {
	Enabled   bool
	CacheSize int
	CacheTTL  time.Duration
	SkipPaths []string // Paths that don't require auth
}

AuthConfig holds authentication configuration

func DefaultAuthConfig added in v1.1.0

func DefaultAuthConfig() AuthConfig

DefaultAuthConfig returns default auth configuration

type AuthMiddleware added in v1.1.0

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

AuthMiddleware creates authentication middleware

func NewAuthMiddleware added in v1.1.0

func NewAuthMiddleware(apiKeyService *service.APIKeyService, config AuthConfig) *AuthMiddleware

NewAuthMiddleware creates a new auth middleware

func (*AuthMiddleware) Middleware added in v1.1.0

func (m *AuthMiddleware) Middleware(next http.Handler) http.Handler

Middleware returns the HTTP middleware function

type MetricsMiddleware added in v1.1.0

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

MetricsMiddleware wraps HTTP handlers to collect request metrics

func NewMetricsMiddleware added in v1.1.0

func NewMetricsMiddleware(collector metrics.Collector) *MetricsMiddleware

NewMetricsMiddleware creates a new metrics middleware

func (*MetricsMiddleware) Middleware added in v1.1.0

func (m *MetricsMiddleware) Middleware(next http.Handler) http.Handler

Middleware returns the middleware handler

type Server

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

Server represents the HTTP server

func New

func New(ctx context.Context, cfg *config.Config) (*Server, error)

New creates a new server instance

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server

func (*Server) Start

func (s *Server) Start() error

Start starts the server

Jump to

Keyboard shortcuts

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