Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureRouter ¶
func RegisterHealthChecker ¶ added in v0.37.0
func RegisterHealthChecker(hc HealthChecker)
RegisterHealthChecker adds a health checker to be queried during health checks
func ResetHealthCheckers ¶ added in v0.37.0
func ResetHealthCheckers()
ResetHealthCheckers clears all registered health checkers. This is intended for use in tests to prevent state leakage between tests.
Types ¶
type API ¶
type API interface {
Start() error
AddRoute(method, path string, handler gin.HandlerFunc)
}
type APIRouteRegistrar ¶
type APIRouteRegistrar interface {
RegisterRoutes()
}
type APIv1 ¶
type APIv1 struct {
ApiGroup *gin.RouterGroup
Host string
Port uint
// contains filtered or unexported fields
}
func GetInstance ¶
func GetInstance() *APIv1
func (*APIv1) Start ¶
@license.name Apache 2.0 @license.url http://www.apache.org/licenses/LICENSE-2.0.html
type EventHub ¶ added in v0.38.0
type EventHub struct {
// contains filtered or unexported fields
}
EventHub manages event broadcasting to connected WebSocket/SSE clients. Call Close() to shut down the hub and release resources.
func NewEventHub ¶ added in v0.38.0
NewEventHub creates a hub with the given ring buffer size.
func (*EventHub) Broadcast ¶ added in v0.38.0
Broadcast sends an event to all connected clients. Called from the pipeline observer goroutine. Non-blocking per client.
The lock is held for the entire client iteration because the cleanup path closes client.send under the same lock. Releasing the lock before sending would allow a concurrent close, causing a send-to-closed-channel panic. The sends are non-blocking (select with default) so lock duration is bounded.
func (*EventHub) Close ¶ added in v0.38.0
func (h *EventHub) Close()
Close shuts down the hub, terminating the InputChan goroutine and allowing client handlers to exit cleanly. Blocks until background goroutines have exited.
func (*EventHub) HandleEvents ¶ added in v0.38.0
HandleEvents is the Gin handler for GET /events. It upgrades to WebSocket if possible, otherwise falls back to SSE.
type HealthChecker ¶ added in v0.37.0
type HealthChecker interface {
IsRunning() bool
}
HealthChecker is an interface for components that can report their health status