Documentation
¶
Index ¶
- func Admin(db *bun.DB) gin.HandlerFunc
- func Auth(db *bun.DB) gin.HandlerFunc
- func Editor(db *bun.DB) gin.HandlerFunc
- func Mixed(db *bun.DB) gin.HandlerFunc
- func PrometheusMiddleware() gin.HandlerFunc
- func Runner(db *bun.DB) gin.HandlerFunc
- func RunnerBusyRateLimit() gin.HandlerFunc
- func RunnerHeartbeatRateLimit() gin.HandlerFunc
- func RunnerRegister(db *bun.DB) gin.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Editor ¶
func Editor(db *bun.DB) gin.HandlerFunc
Editor middleware restricts access to users with the "editor" or "admin" global role, as well as service tokens. It follows the same validation flow as the Admin middleware.
func PrometheusMiddleware ¶
func PrometheusMiddleware() gin.HandlerFunc
PrometheusMiddleware records metrics for each request
func Runner ¶
func Runner(db *bun.DB) gin.HandlerFunc
Runner validates JWT tokens for authenticated runner endpoints. The shared runner secret is NOT accepted here — use RunnerRegister for /register.
func RunnerBusyRateLimit ¶
func RunnerBusyRateLimit() gin.HandlerFunc
RunnerBusyRateLimit allows at most one busy request per runner per second.
func RunnerHeartbeatRateLimit ¶
func RunnerHeartbeatRateLimit() gin.HandlerFunc
RunnerHeartbeatRateLimit allows at most one heartbeat request per runner every 5 seconds.
func RunnerRegister ¶
func RunnerRegister(db *bun.DB) gin.HandlerFunc
RunnerRegister validates runner tokens for the /register endpoint. Accepts both JWT tokens and the configured shared runner secret.
Types ¶
This section is empty.