registerBillingAPI mounts the billing pull API on an authenticated route group. The caller passes the admin-gating middleware (the billing service authenticates with the internal secret, which resolves to admin).
(r gin.IRouter, store billingUsageStore, requireAdmin gin.HandlerFunc)
| 30 | now func() time.Time |
| 31 | } |
| 32 | |
| 33 | // registerBillingAPI mounts the billing pull API on an authenticated route |
| 34 | // group. The caller passes the admin-gating middleware (the billing service |
| 35 | // authenticates with the internal secret, which resolves to admin). |
| 36 | func registerBillingAPI(r gin.IRouter, store billingUsageStore, requireAdmin gin.HandlerFunc) { |
| 37 | h := &billingAPIHandler{store: store, now: time.Now} |
| 38 | // gzip on the usage read: rows scale with total adoption (one per |
| 39 | // storage-holding org per day, several per compute-active org) and the |
no outgoing calls