Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Transport mode: "http" or "stdio"
Transport string
// HTTP server settings (only used when Transport == "http")
ListenAddr string
// UptimeURL is the Uptime.com instance URL (e.g., https://uptime.com).
// Used to derive both the API base URL (UptimeURL + "/api/v1/") and the
// OAuth2 authorization server endpoints when APIURL / OAuthURL are unset.
UptimeURL string
// APIURL, when non-empty, is the full Uptime.com API base URL, used
// verbatim instead of deriving it from UptimeURL. Useful in split-horizon
// deployments where the API is reached over an internal address.
APIURL string
// OAuthURL, when non-empty, is the full OAuth2 authorization server base
// (issuer), used verbatim instead of UptimeURL. Useful when the client-facing
// authorization server differs from the internal API host.
OAuthURL string
// ResourceURL is this server's public URL for OAuth2 protected resource metadata.
// Defaults to http://localhost{ListenAddr} when not set.
ResourceURL string
// ClientID is the OAuth2 client ID.
ClientID string
// ClientSecret is the OAuth2 client secret (confidential clients).
ClientSecret string
// LogLevel for application logger (debug, info, warn, error)
LogLevel *slog.LevelVar
}
Config holds the application configuration from CLI flags.
func (Config) APIBaseURL ¶
APIBaseURL returns the Uptime.com API base URL. When APIURL is set it is used verbatim; otherwise the base is derived from UptimeURL.
func (Config) OAuthIssuer ¶ added in v0.17.0
OAuthIssuer returns the OAuth2 authorization server base (issuer). When OAuthURL is set it is used verbatim; otherwise it falls back to UptimeURL.
type Session ¶
Session holds per-session state including the authenticated Uptime client. Client is created once per session by middleware and cached.
func SessionFromContext ¶
SessionFromContext retrieves session from context.
Click to show internal directories.
Click to hide internal directories.