Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindAvailablePort ¶
FindAvailablePort finds an available port starting from the given port, binding to the specified host.
Types ¶
type Option ¶
type Option func(*Server)
Option configures a Server.
func WithGenerateFunc ¶ added in v0.4.0
func WithGenerateFunc(f insight.GenerateFunc) Option
WithGenerateFunc overrides the insight generation function, allowing tests to substitute a stub. Nil is ignored.
func WithVersion ¶
func WithVersion(v VersionInfo) Option
WithVersion sets the build-time version metadata.
type SSEStream ¶
type SSEStream struct {
// contains filtered or unexported fields
}
SSEStream manages a Server-Sent Events connection.
func NewSSEStream ¶
func NewSSEStream(w http.ResponseWriter) (*SSEStream, error)
NewSSEStream initializes an SSE connection by setting the required headers and flushing them to the client. Returns an error if the ResponseWriter does not support streaming.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the HTTP server that serves the SPA and REST API.
func (*Server) ListenAndServe ¶
ListenAndServe starts the HTTP server.
func (*Server) SetGithubToken ¶
SetGithubToken updates the GitHub token for testing.
type VersionInfo ¶
type VersionInfo struct {
Version string `json:"version"`
Commit string `json:"commit"`
BuildDate string `json:"build_date"`
}
VersionInfo holds build-time version metadata.