add new argument for allow origins and query without path and only uuid
This commit is contained in:
@@ -25,10 +25,9 @@ var SystemDatapoints uuid.UUID
|
||||
|
||||
func NewDBM(conns *serverModels.Connections, log *logging.Logger) *DBM {
|
||||
return &DBM{
|
||||
Datapoints: Datapoint{},
|
||||
Uuids: make(Uuids),
|
||||
Conns: conns,
|
||||
Log: log,
|
||||
Uuids: make(Uuids),
|
||||
Conns: conns,
|
||||
Log: log,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,8 +107,10 @@ func (d *DBM) QueryDatapoints(depth uint, uid uuid.UUID, key ...string) []*Datap
|
||||
return nil
|
||||
}
|
||||
dp := d.Uuids[uid]
|
||||
dps := []*Datapoint{dp}
|
||||
return append(dps, dp.QueryDatapoints(depth, key[0])...)
|
||||
if depth == 1 {
|
||||
return []*Datapoint{dp}
|
||||
}
|
||||
return append([]*Datapoint{}, dp.QueryDatapoints(depth, key[0])...)
|
||||
}
|
||||
return d.Datapoints.QueryDatapoints(depth, key[0])
|
||||
}
|
||||
|
Reference in New Issue
Block a user