Documentation
¶
Overview ¶
Package server wires up the HTTP server with all routes.
Package server wires together all ghp components and runs the HTTP server(s). It is responsible for:
- Opening the database and running/checking migrations
- Initializing encryption, token services, and the GitHub App provider
- Building the host-dispatch handler that routes requests by Host header to the appropriate backend (API proxy, github.com passthrough, codeload.github.com redirect/passthrough, Copilot passthrough, or management UI)
- Starting TLS and/or plain HTTP listeners (including systemd socket activation support)
- Running the dedicated Prometheus metrics server on a separate port
- Handling graceful shutdown (SIGINT/SIGTERM) and configuration hot-reload (SIGUSR1)
- Applying cross-cutting middleware: access logging, security headers, and the Server response header
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API handles the service API endpoints (token management, users).
func NewAPI ¶
func NewAPI(ctx context.Context, cfg *config.Config, store database.Store, ts *token.Service, ah *auth.Handler, enc *crypto.Encryptor, atp *ghpgithub.AppTokenProvider, ar *ghpgithub.AppRegistry, ptr *proxy.ProxyTokenResolver, ur *proxy.UsernameResolver, logger *slog.Logger, aw *auditLogWriter) *API
NewAPI creates a new API handler.
func (*API) RegisterRoutes ¶
RegisterRoutes adds API routes to the given mux. All routes require authentication via the auth handler.
Click to show internal directories.
Click to hide internal directories.