Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions build/deploy/atlas/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
atlas-api:
image: ghcr.io/thingspect/atlas:668811d
image: ghcr.io/thingspect/atlas:aa4f930
command: atlas-api
restart: on-failure
ports:
Expand All @@ -22,7 +22,7 @@ services:
- API_LORA_DEV_PROF_ID=00000000-0000-0000-0000-000000000000

atlas-mqtt-ingestor:
image: ghcr.io/thingspect/atlas:668811d
image: ghcr.io/thingspect/atlas:aa4f930
command: atlas-mqtt-ingestor
restart: on-failure
environment:
Expand All @@ -32,7 +32,7 @@ services:
- MQTT_INGEST_NSQ_PUB_ADDR=nsqd:4150

atlas-lora-ingestor:
image: ghcr.io/thingspect/atlas:668811d
image: ghcr.io/thingspect/atlas:aa4f930
command: atlas-lora-ingestor
restart: on-failure
environment:
Expand All @@ -42,7 +42,7 @@ services:
- LORA_INGEST_NSQ_PUB_ADDR=nsqd:4150

atlas-decoder:
image: ghcr.io/thingspect/atlas:668811d
image: ghcr.io/thingspect/atlas:aa4f930
command: atlas-decoder
restart: on-failure
environment:
Expand All @@ -53,7 +53,7 @@ services:
- DECODER_NSQ_LOOKUP_ADDRS=nsqlookupd:4161

atlas-validator:
image: ghcr.io/thingspect/atlas:668811d
image: ghcr.io/thingspect/atlas:aa4f930
command: atlas-validator
restart: on-failure
environment:
Expand All @@ -64,7 +64,7 @@ services:
- VALIDATOR_NSQ_LOOKUP_ADDRS=nsqlookupd:4161

atlas-accumulator:
image: ghcr.io/thingspect/atlas:668811d
image: ghcr.io/thingspect/atlas:aa4f930
command: atlas-accumulator
restart: on-failure
environment:
Expand All @@ -75,7 +75,7 @@ services:
- ACCUMULATOR_NSQ_LOOKUP_ADDRS=nsqlookupd:4161

atlas-eventer:
image: ghcr.io/thingspect/atlas:668811d
image: ghcr.io/thingspect/atlas:aa4f930
command: atlas-eventer
restart: on-failure
environment:
Expand All @@ -86,7 +86,7 @@ services:
- EVENTER_NSQ_LOOKUP_ADDRS=nsqlookupd:4161

atlas-alerter:
image: ghcr.io/thingspect/atlas:668811d
image: ghcr.io/thingspect/atlas:aa4f930
command: atlas-alerter
restart: on-failure
environment:
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/thingspect/proto/go v1.1.22
github.com/valkey-io/valkey-go v1.0.77
go.uber.org/mock v0.6.0
golang.org/x/crypto v0.56.0
golang.org/x/crypto v0.57.0
google.golang.org/grpc v1.83.2
google.golang.org/protobuf v1.36.12
)
Expand All @@ -39,8 +39,8 @@ require (
github.com/jackc/puddle/v2 v2.2.2 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
golang.org/x/exp v0.0.0-20260824195058-e88cd73687aa // indirect
golang.org/x/net v0.58.0 // indirect
golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba // indirect
golang.org/x/net v0.59.0 // indirect
golang.org/x/sync v0.23.0 // indirect
golang.org/x/sys v0.48.0 // indirect
golang.org/x/text v0.42.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw=
go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
golang.org/x/crypto v0.56.0 h1:GUh5Ii4J5jtcseSMiRqr1jXCNHoxjeV9Fmekc2oLy6Y=
golang.org/x/crypto v0.56.0/go.mod h1:OMW5y6CY9l38uPLmxU6l6pwcXp1obtLo3e6gT7gQR2I=
golang.org/x/exp v0.0.0-20260824195058-e88cd73687aa h1:QSyA8ishJCyT21kER9KwNt0b7BM3iRK4x9QXhjN5Fdk=
golang.org/x/exp v0.0.0-20260824195058-e88cd73687aa/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM=
golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To=
golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU=
golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M=
golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA=
golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba h1:Ck8QetSgk912qxWLMCKxd0in+aiyBQyDSMae6e/xmpU=
golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba/go.mod h1:50RgIsmK7OwqzTTeqcSXQW8SswW0o8fRcDxmqGluJ8E=
golang.org/x/net v0.59.0 h1:5zfYln+w5XCxwrnMMJPufRgNoXEaGxl0wo5GqPXyues=
golang.org/x/net v0.59.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg=
golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk=
golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo=
Expand Down
22 changes: 10 additions & 12 deletions pkg/dao/alarm/crudl.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"time"

"github.com/jackc/pgx/v5/pgtype"
"github.com/thingspect/atlas/pkg/alog"
"github.com/thingspect/atlas/pkg/dao"
"github.com/thingspect/proto/go/api"
Expand Down Expand Up @@ -53,11 +52,11 @@ func (d *DAO) Read(ctx context.Context, alarmID, orgID, ruleID string) (
var status, alarmType string
var createdAt, updatedAt time.Time

if err := d.ro.QueryRowContext(ctx, readAlarm, alarmID, orgID, ruleID).Scan(
&alarm.Id, &alarm.OrgId, &alarm.RuleId, &alarm.Name, &status,
&alarmType, pgtype.NewMap().SQLScanner(&alarm.UserTags),
&alarm.SubjectTemplate, &alarm.BodyTemplate, &alarm.RepeatInterval,
&createdAt, &updatedAt); err != nil {
if err := d.ro.QueryRowContext(ctx, readAlarm, alarmID, orgID, ruleID).
Scan(&alarm.Id, &alarm.OrgId, &alarm.RuleId, &alarm.Name, &status,
&alarmType, &alarm.UserTags, &alarm.SubjectTemplate,
&alarm.BodyTemplate, &alarm.RepeatInterval, &createdAt,
&updatedAt); err != nil {
return nil, dao.DBToSentinel(err)
}

Expand Down Expand Up @@ -170,8 +169,8 @@ func (d *DAO) List(

// Run count query.
var count int32
if err := d.ro.QueryRowContext(ctx, cQuery, cArgs...).Scan(
&count); err != nil {
if err := d.ro.QueryRowContext(ctx, cQuery, cArgs...).
Scan(&count); err != nil {
return nil, 0, dao.DBToSentinel(err)
}

Expand Down Expand Up @@ -211,16 +210,15 @@ func (d *DAO) List(
}()

var alarms []*api.Alarm
pgtmap := pgtype.NewMap()
for rows.Next() {
alarm := &api.Alarm{}
var status, alarmType string
var createdAt, updatedAt time.Time

if err = rows.Scan(&alarm.Id, &alarm.OrgId, &alarm.RuleId, &alarm.Name,
&status, &alarmType, pgtmap.SQLScanner(&alarm.UserTags),
&alarm.SubjectTemplate, &alarm.BodyTemplate, &alarm.RepeatInterval,
&createdAt, &updatedAt); err != nil {
&status, &alarmType, &alarm.UserTags, &alarm.SubjectTemplate,
&alarm.BodyTemplate, &alarm.RepeatInterval, &createdAt,
&updatedAt); err != nil {
return nil, 0, dao.DBToSentinel(err)
}

Expand Down
18 changes: 7 additions & 11 deletions pkg/dao/device/crudl.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"strings"
"time"

"github.com/jackc/pgx/v5/pgtype"
"github.com/thingspect/atlas/pkg/alog"
"github.com/thingspect/atlas/pkg/cache"
"github.com/thingspect/atlas/pkg/dao"
Expand Down Expand Up @@ -76,8 +75,7 @@ func (d *DAO) Read(ctx context.Context, devID, orgID string) (

if err := d.ro.QueryRowContext(ctx, readDevice, devID, orgID).Scan(&dev.Id,
&dev.OrgId, &dev.UniqId, &dev.Name, &status, &dev.Token, &decoder,
pgtype.NewMap().SQLScanner(&dev.Tags), &createdAt,
&updatedAt); err != nil {
&dev.Tags, &createdAt, &updatedAt); err != nil {
return nil, dao.DBToSentinel(err)
}

Expand Down Expand Up @@ -138,10 +136,9 @@ func (d *DAO) ReadByUniqID(ctx context.Context, uniqID string) (
var status, decoder string
var createdAt, updatedAt time.Time

if err := d.ro.QueryRowContext(ctx, readDeviceByUniqID, uniqID).Scan(
&dev.Id, &dev.OrgId, &dev.UniqId, &dev.Name, &status, &dev.Token,
&decoder, pgtype.NewMap().SQLScanner(&dev.Tags), &createdAt,
&updatedAt); err != nil {
if err := d.ro.QueryRowContext(ctx, readDeviceByUniqID, uniqID).
Scan(&dev.Id, &dev.OrgId, &dev.UniqId, &dev.Name, &status, &dev.Token,
&decoder, &dev.Tags, &createdAt, &updatedAt); err != nil {
return nil, dao.DBToSentinel(err)
}

Expand Down Expand Up @@ -301,8 +298,8 @@ func (d *DAO) List(

// Run count query.
var count int32
if err := d.ro.QueryRowContext(ctx, cQuery, cArgs...).Scan(
&count); err != nil {
if err := d.ro.QueryRowContext(ctx, cQuery, cArgs...).
Scan(&count); err != nil {
return nil, 0, dao.DBToSentinel(err)
}

Expand Down Expand Up @@ -342,14 +339,13 @@ func (d *DAO) List(
}()

var devs []*api.Device
pgtmap := pgtype.NewMap()
for rows.Next() {
dev := &api.Device{}
var status, decoder string
var createdAt, updatedAt time.Time

if err = rows.Scan(&dev.Id, &dev.OrgId, &dev.UniqId, &dev.Name, &status,
&dev.Token, &decoder, pgtmap.SQLScanner(&dev.Tags), &createdAt,
&dev.Token, &decoder, &dev.Tags, &createdAt,
&updatedAt); err != nil {
return nil, 0, dao.DBToSentinel(err)
}
Expand Down
31 changes: 14 additions & 17 deletions pkg/dao/user/crudl.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"time"

"github.com/jackc/pgx/v5/pgtype"
"github.com/thingspect/atlas/pkg/alog"
"github.com/thingspect/atlas/pkg/dao"
"github.com/thingspect/proto/go/api"
Expand Down Expand Up @@ -50,10 +49,10 @@ func (d *DAO) Read(ctx context.Context, userID, orgID string) (
var role, status string
var createdAt, updatedAt time.Time

if err := d.ro.QueryRowContext(ctx, readUser, userID, orgID).Scan(&user.Id,
&user.OrgId, &user.Name, &user.Email, &user.Phone, &role, &status,
pgtype.NewMap().SQLScanner(&user.Tags), &user.AppKey, &createdAt,
&updatedAt); err != nil {
if err := d.ro.QueryRowContext(ctx, readUser, userID, orgID).
Scan(&user.Id, &user.OrgId, &user.Name, &user.Email, &user.Phone, &role,
&status, &user.Tags, &user.AppKey, &createdAt,
&updatedAt); err != nil {
return nil, dao.DBToSentinel(err)
}

Expand Down Expand Up @@ -82,10 +81,10 @@ func (d *DAO) ReadByEmail(ctx context.Context, email, orgName string) (
var role, status string
var createdAt, updatedAt time.Time

if err := d.ro.QueryRowContext(ctx, readUserByEmail, email, orgName).Scan(
&user.Id, &user.OrgId, &user.Name, &user.Email, &user.Phone, &passHash,
&role, &status, pgtype.NewMap().SQLScanner(&user.Tags), &user.AppKey,
&createdAt, &updatedAt); err != nil {
if err := d.ro.QueryRowContext(ctx, readUserByEmail, email, orgName).
Scan(&user.Id, &user.OrgId, &user.Name, &user.Email, &user.Phone,
&passHash, &role, &status, &user.Tags, &user.AppKey, &createdAt,
&updatedAt); err != nil {
return nil, nil, dao.DBToSentinel(err)
}

Expand Down Expand Up @@ -217,8 +216,8 @@ func (d *DAO) List(

// Run count query.
var count int32
if err := d.ro.QueryRowContext(ctx, cQuery, cArgs...).Scan(
&count); err != nil {
if err := d.ro.QueryRowContext(ctx, cQuery, cArgs...).
Scan(&count); err != nil {
return nil, 0, dao.DBToSentinel(err)
}

Expand Down Expand Up @@ -258,15 +257,14 @@ func (d *DAO) List(
}()

var users []*api.User
pgtmap := pgtype.NewMap()
for rows.Next() {
user := &api.User{}
var role, status string
var createdAt, updatedAt time.Time

if err = rows.Scan(&user.Id, &user.OrgId, &user.Name, &user.Email,
&user.Phone, &role, &status, pgtmap.SQLScanner(&user.Tags),
&user.AppKey, &createdAt, &updatedAt); err != nil {
&user.Phone, &role, &status, &user.Tags, &user.AppKey, &createdAt,
&updatedAt); err != nil {
return nil, 0, dao.DBToSentinel(err)
}

Expand Down Expand Up @@ -312,15 +310,14 @@ func (d *DAO) ListByTags(ctx context.Context, orgID string, tags []string) (
}()

var users []*api.User
pgtmap := pgtype.NewMap()
for rows.Next() {
user := &api.User{}
var role, status string
var createdAt, updatedAt time.Time

if err = rows.Scan(&user.Id, &user.OrgId, &user.Name, &user.Email,
&user.Phone, &role, &status, pgtmap.SQLScanner(&user.Tags),
&user.AppKey, &createdAt, &updatedAt); err != nil {
&user.Phone, &role, &status, &user.Tags, &user.AppKey, &createdAt,
&updatedAt); err != nil {
return nil, dao.DBToSentinel(err)
}

Expand Down
14 changes: 13 additions & 1 deletion vendor/golang.org/x/net/http2/ascii.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions vendor/golang.org/x/net/http2/databuffer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading