wip: cleanup

This commit is contained in:
saji 2024-02-24 22:57:17 -06:00
parent 027bde3e68
commit 0afb8d48bd
2 changed files with 1 additions and 38 deletions

View file

@ -77,7 +77,7 @@ func apiV1(broker *Broker, db *db.TelemDb) chi.Router {
})
// this is to get a single field
r.Get("/{name:[a-z_]+}/{field:[a-z_]+}")
r.Get("/{name:[a-z_]+}/{field:[a-z_]+}", apiV1GetValues(db))
})

View file

@ -3,7 +3,6 @@ package db
import (
"context"
"fmt"
"strings"
"time"
)
@ -25,42 +24,6 @@ type BusEventFilter struct {
TimerangeEnd time.Time
}
func (bef *BusEventFilter) String() string {
var sb []string = make([]string, 0, 2)
if len(bef.Names) > 0 {
names := strings.Join(bef.Names, ",")
sb = append(sb, fmt.Sprintf("name IN (%s)", names))
}
if !bef.TimerangeStart.IsZero() && !bef.TimerangeEnd.IsZero() {
sb = append(sb, fmt.Sprintf(""))
}
return ""
}
type BusEventElement interface {
Element() string
}
type NormalExtract struct {
Key string
}
type JSONExtract struct {
Key string
}
type BusEventQuery struct {
Elements []BusEventElement
Filter BusEventFilter
Limits LimitOffsetModifier
}
func (beq *BusEventQuery) String() string {
// select
return ""
}
// now we can optionally add a limit.
// Datum is a single measurement - it is more granular than a packet.