Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Host string
Port int
ShutdownTimeout time.Duration
CORSOrigins []string
EnableUI bool
MaxBodySize int64 // bytes
}
Config holds the HTTP server configuration.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config with sensible production defaults.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the top-level HTTP server for Faucet. It owns the Chi router, the connector registry, configuration store, and authentication service.
func New ¶
func New(cfg Config, registry *connector.Registry, store *config.Store, authSvc *service.AuthService, logger *slog.Logger) *Server
New creates a new Server, wires up all routes and middleware, and returns it ready to listen. Call ListenAndServe to start accepting connections.
func (*Server) ListenAndServe ¶
ListenAndServe starts the HTTP server and blocks until a SIGINT or SIGTERM is received. It then performs a graceful shutdown, draining in-flight requests before closing all database connections.
Click to show internal directories.
Click to hide internal directories.