mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
console: factor graphXXXHandlerInput
This is similar to what is done in TypeScript.
This commit is contained in:
23
console/graph.go
Normal file
23
console/graph.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// SPDX-FileCopyrightText: 2023 Free Mobile
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"akvorado/common/schema"
|
||||
"akvorado/console/query"
|
||||
)
|
||||
|
||||
// graphCommonHandlerInput is for bits common to graphLineHandlerInput and
|
||||
// graphSankeyHandlerInput.
|
||||
type graphCommonHandlerInput struct {
|
||||
schema *schema.Component
|
||||
Start time.Time `json:"start" binding:"required"`
|
||||
End time.Time `json:"end" binding:"required,gtfield=Start"`
|
||||
Dimensions []query.Column `json:"dimensions"` // group by ...
|
||||
Limit int `json:"limit" binding:"min=1"` // limit product of dimensions
|
||||
Filter query.Filter `json:"filter"` // where ...
|
||||
Units string `json:"units" binding:"required,oneof=pps l3bps l2bps inl2% outl2%"`
|
||||
}
|
||||
Reference in New Issue
Block a user