wip: cleanup
This commit is contained in:
parent
027bde3e68
commit
0afb8d48bd
2
http.go
2
http.go
|
@ -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))
|
||||
|
||||
})
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue