mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
console: implement an HTTP cache for Clickhouse-backed requests
Fix #328
This commit is contained in:
@@ -81,15 +81,15 @@ func (c *Component) Start() error {
|
||||
endpoint := c.d.HTTP.GinRouter.Group("/api/v0/console", c.d.Auth.UserAuthentication())
|
||||
endpoint.GET("/configuration", c.configHandlerFunc)
|
||||
endpoint.GET("/docs/:name", c.docsHandlerFunc)
|
||||
endpoint.GET("/widget/flow-last", c.widgetFlowLastHandlerFunc)
|
||||
endpoint.GET("/widget/flow-rate", c.widgetFlowRateHandlerFunc)
|
||||
endpoint.GET("/widget/exporters", c.widgetExportersHandlerFunc)
|
||||
endpoint.GET("/widget/top/:name", c.widgetTopHandlerFunc)
|
||||
endpoint.GET("/widget/graph", c.widgetGraphHandlerFunc)
|
||||
endpoint.POST("/graph", c.graphHandlerFunc)
|
||||
endpoint.POST("/sankey", c.sankeyHandlerFunc)
|
||||
endpoint.GET("/widget/flow-last", c.d.HTTP.CacheByRequestPath(5*time.Second), c.widgetFlowLastHandlerFunc)
|
||||
endpoint.GET("/widget/flow-rate", c.d.HTTP.CacheByRequestPath(5*time.Second), c.widgetFlowRateHandlerFunc)
|
||||
endpoint.GET("/widget/exporters", c.d.HTTP.CacheByRequestPath(30*time.Second), c.widgetExportersHandlerFunc)
|
||||
endpoint.GET("/widget/top/:name", c.d.HTTP.CacheByRequestPath(30*time.Second), c.widgetTopHandlerFunc)
|
||||
endpoint.GET("/widget/graph", c.d.HTTP.CacheByRequestPath(5*time.Minute), c.widgetGraphHandlerFunc)
|
||||
endpoint.POST("/graph", c.d.HTTP.CacheByRequestBody(30*time.Minute), c.graphHandlerFunc)
|
||||
endpoint.POST("/sankey", c.d.HTTP.CacheByRequestBody(30*time.Minute), c.sankeyHandlerFunc)
|
||||
endpoint.POST("/filter/validate", c.filterValidateHandlerFunc)
|
||||
endpoint.POST("/filter/complete", c.filterCompleteHandlerFunc)
|
||||
endpoint.POST("/filter/complete", c.d.HTTP.CacheByRequestBody(time.Minute), c.filterCompleteHandlerFunc)
|
||||
endpoint.GET("/filter/saved", c.filterSavedListHandlerFunc)
|
||||
endpoint.DELETE("/filter/saved/:id", c.filterSavedDeleteHandlerFunc)
|
||||
endpoint.POST("/filter/saved", c.filterSavedAddHandlerFunc)
|
||||
|
||||
Reference in New Issue
Block a user