Documentation
¶
Index ¶
- Variables
- func AuthRequired(apiAuth string) gin.HandlerFunc
- func GetClient(ctx context.Context, projectId string) *firestore.Client
- func Last12Months() [12]string
- func Last24Hours() [24]string
- func Last4Years() [4]string
- func Last5Weeks() [5]string
- func Last60Minutes() [60]string
- func Last7Days() [7]string
- func SecurityMiddleware(dev bool) gin.HandlerFunc
- type DBDataPoint
- type EventsResponse
- type LastEventContainer
- type ResponseDataPoint
- type Server
- type StatsResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAccessDenied = errors.New("access denied")
Functions ¶
func AuthRequired ¶
func AuthRequired(apiAuth string) gin.HandlerFunc
func Last12Months ¶
func Last12Months() [12]string
func Last24Hours ¶
func Last24Hours() [24]string
func Last4Years ¶
func Last4Years() [4]string
func Last5Weeks ¶
func Last5Weeks() [5]string
func Last60Minutes ¶
func Last60Minutes() [60]string
func SecurityMiddleware ¶
func SecurityMiddleware(dev bool) gin.HandlerFunc
Types ¶
type DBDataPoint ¶
type DBDataPoint struct { Counter int64 `json:"c",firestore:"counter"` Meters float32 `json:"m",firestore:"meters"` MetersPerSecond float32 `json:"mps",firestore:"mps"` KilometersPerHour float32 `json:"kph",firestore:"kph"` }
Timestamp is key, need counter for updating averages
type EventsResponse ¶
type EventsResponse struct {
Events []ResponseDataPoint `json:"events"`
}
type LastEventContainer ¶
type LastEventContainer struct {
Events []ResponseDataPoint `firestore:"events"`
}
type ResponseDataPoint ¶
type StatsResponse ¶
type StatsResponse struct { EventTimestamps []string `json:"eventTimestamps"` DataPoints []ResponseDataPoint `json:"dataPoints"` }
Click to show internal directories.
Click to hide internal directories.