Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LocalhostOnly ¶
func LocalhostOnly() gin.HandlerFunc
LocalhostOnly returns middleware that restricts access to loopback addresses.
func UsageMiddleware ¶
func UsageMiddleware(usageStore *store.UsageStore) gin.HandlerFunc
UsageMiddleware records API usage statistics via a Gin middleware.
Types ¶
type StreamUsageAccumulator ¶ added in v0.1.4
StreamUsageAccumulator accumulates token usage from SSE data lines.
func (*StreamUsageAccumulator) Sniff ¶ added in v0.1.4
func (a *StreamUsageAccumulator) Sniff(data string, format string)
Sniff parses a single SSE data line and accumulates usage fields.
Click to show internal directories.
Click to hide internal directories.