Documentation
¶
Index ¶
- func DocsShellHTML(opts DocsShellOptions) string
- func OutcomeForStatus(status int) string
- type DocsShellOptions
- type Event
- type EventFeed
- func (f *EventFeed) Capture(next http.Handler, methodHint, pathHint string) http.Handler
- func (f *EventFeed) RecordRequest(method, path string, status int, duration time.Duration, bytes int64)
- func (f *EventFeed) RecordSystem(message string)
- func (f *EventFeed) ServeJSON(w http.ResponseWriter, req *http.Request)
- func (f *EventFeed) ServeStream(w http.ResponseWriter, req *http.Request)
- func (f *EventFeed) Snapshot(limit int) []Event
- type SQLCatalog
- type SQLFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DocsShellHTML ¶
func DocsShellHTML(opts DocsShellOptions) string
DocsShellHTML renders the docs/admin shell HTML.
func OutcomeForStatus ¶
OutcomeForStatus returns one of ok, invalid, or err for quick UI summaries.
Types ¶
type DocsShellOptions ¶
type DocsShellOptions struct {
Title string
OpenAPIURL string
SQLCatalogURL string
EventsURL string
EventsStreamURL string
LoggingStatusURL string
}
DocsShellOptions configures the integrated docs/admin UI shell.
type Event ¶
type Event struct {
ID int64 `json:"id"`
Time string `json:"time"`
Kind string `json:"kind"`
Method string `json:"method,omitempty"`
Path string `json:"path,omitempty"`
Status int `json:"status,omitempty"`
DurationMS int64 `json:"durationMs,omitempty"`
Bytes int64 `json:"bytes,omitempty"`
Outcome string `json:"outcome,omitempty"`
Message string `json:"message,omitempty"`
}
Event represents one admin-console activity row.
type EventFeed ¶
type EventFeed struct {
// contains filtered or unexported fields
}
EventFeed keeps a bounded in-memory feed and broadcasts live updates via SSE.
func NewEventFeed ¶
NewEventFeed returns an in-memory event feed with a bounded history.
func (*EventFeed) RecordRequest ¶
func (f *EventFeed) RecordRequest(method, path string, status int, duration time.Duration, bytes int64)
RecordRequest appends one request outcome to the feed.
func (*EventFeed) RecordSystem ¶
RecordSystem appends a non-request event to the feed.
func (*EventFeed) ServeJSON ¶
func (f *EventFeed) ServeJSON(w http.ResponseWriter, req *http.Request)
ServeJSON serves a JSON snapshot of recent events.
func (*EventFeed) ServeStream ¶
func (f *EventFeed) ServeStream(w http.ResponseWriter, req *http.Request)
ServeStream serves live events using Server-Sent Events.
type SQLCatalog ¶
type SQLCatalog struct {
Root string `json:"root"`
Missing bool `json:"missing"`
Error string `json:"error,omitempty"`
Schemas []SQLFile `json:"schemas"`
Queries []SQLFile `json:"queries"`
}
SQLCatalog summarizes schema/query files under db/sql for docs display.
func LoadSQLCatalog ¶
func LoadSQLCatalog(root string) SQLCatalog
LoadSQLCatalog reads schema/query SQL files from root (defaults to db/sql).