Skip to content

Commit

Permalink
Use Magistrala packages where needed
Browse files Browse the repository at this point in the history
Signed-off-by: Dusan Borovcanin <[email protected]>
  • Loading branch information
dborovcanin committed Dec 31, 2024
1 parent b32e6b2 commit 5200ca5
Show file tree
Hide file tree
Showing 41 changed files with 63 additions and 84 deletions.
2 changes: 1 addition & 1 deletion bootstrap/api/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ package api
import (
"context"

"github.com/absmach/magistrala/bootstrap"
api "github.com/absmach/supermq/api/http"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/bootstrap"
"github.com/absmach/supermq/pkg/authn"
"github.com/absmach/supermq/pkg/errors"
svcerr "github.com/absmach/supermq/pkg/errors/service"
Expand Down
6 changes: 3 additions & 3 deletions bootstrap/api/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"strings"
"testing"

"github.com/absmach/magistrala/bootstrap"
bsapi "github.com/absmach/magistrala/bootstrap/api"
"github.com/absmach/magistrala/bootstrap/mocks"
"github.com/absmach/magistrala/internal/testsutil"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/bootstrap"
bsapi "github.com/absmach/supermq/bootstrap/api"
"github.com/absmach/supermq/bootstrap/mocks"
smqlog "github.com/absmach/supermq/logger"
smqauthn "github.com/absmach/supermq/pkg/authn"
authnmocks "github.com/absmach/supermq/pkg/authn/mocks"
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/api/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
package api

import (
"github.com/absmach/magistrala/bootstrap"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/bootstrap"
)

const maxLimitSize = 100
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/api/requests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"fmt"
"testing"

"github.com/absmach/magistrala/bootstrap"
"github.com/absmach/magistrala/internal/testsutil"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/bootstrap"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion bootstrap/api/responses.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"fmt"
"net/http"

"github.com/absmach/magistrala/bootstrap"
"github.com/absmach/supermq"
"github.com/absmach/supermq/bootstrap"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/api/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"net/url"
"strings"

"github.com/absmach/magistrala/bootstrap"
"github.com/absmach/supermq"
api "github.com/absmach/supermq/api/http"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/bootstrap"
smqauthn "github.com/absmach/supermq/pkg/authn"
"github.com/absmach/supermq/pkg/errors"
"github.com/go-chi/chi/v5"
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/events/consumer/streams.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"context"
"time"

"github.com/absmach/supermq/bootstrap"
"github.com/absmach/magistrala/bootstrap"
svcerr "github.com/absmach/supermq/pkg/errors/service"
"github.com/absmach/supermq/pkg/events"
)
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/events/producer/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package producer

import (
"github.com/absmach/supermq/bootstrap"
"github.com/absmach/magistrala/bootstrap"
"github.com/absmach/supermq/pkg/events"
)

Expand Down
2 changes: 1 addition & 1 deletion bootstrap/events/producer/streams.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package producer
import (
"context"

"github.com/absmach/supermq/bootstrap"
"github.com/absmach/magistrala/bootstrap"
smqauthn "github.com/absmach/supermq/pkg/authn"
"github.com/absmach/supermq/pkg/events"
)
Expand Down
6 changes: 3 additions & 3 deletions bootstrap/events/producer/streams_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"testing"
"time"

"github.com/absmach/magistrala/bootstrap"
"github.com/absmach/magistrala/bootstrap/events/producer"
"github.com/absmach/magistrala/bootstrap/mocks"
"github.com/absmach/magistrala/internal/testsutil"
"github.com/absmach/supermq/bootstrap"
"github.com/absmach/supermq/bootstrap/events/producer"
"github.com/absmach/supermq/bootstrap/mocks"
"github.com/absmach/supermq/pkg/authn"
smqauthn "github.com/absmach/supermq/pkg/authn"
"github.com/absmach/supermq/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/middleware/authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package middleware
import (
"context"

"github.com/absmach/supermq/bootstrap"
"github.com/absmach/magistrala/bootstrap"
smqauthn "github.com/absmach/supermq/pkg/authn"
"github.com/absmach/supermq/pkg/authz"
smqauthz "github.com/absmach/supermq/pkg/authz"
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/middleware/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"log/slog"
"time"

"github.com/absmach/supermq/bootstrap"
"github.com/absmach/magistrala/bootstrap"
smqauthn "github.com/absmach/supermq/pkg/authn"
)

Expand Down
2 changes: 1 addition & 1 deletion bootstrap/middleware/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"context"
"time"

"github.com/absmach/supermq/bootstrap"
"github.com/absmach/magistrala/bootstrap"
smqauthn "github.com/absmach/supermq/pkg/authn"
"github.com/go-kit/kit/metrics"
)
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/mocks/config_reader.go

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

2 changes: 1 addition & 1 deletion bootstrap/mocks/configs.go

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

2 changes: 1 addition & 1 deletion bootstrap/mocks/service.go

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

2 changes: 1 addition & 1 deletion bootstrap/postgres/configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"
"time"

"github.com/absmach/supermq/bootstrap"
"github.com/absmach/magistrala/bootstrap"
"github.com/absmach/supermq/clients"
"github.com/absmach/supermq/pkg/errors"
repoerr "github.com/absmach/supermq/pkg/errors/repository"
Expand Down
4 changes: 2 additions & 2 deletions bootstrap/postgres/configs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"strconv"
"testing"

"github.com/absmach/magistrala/bootstrap"
"github.com/absmach/magistrala/bootstrap/postgres"
"github.com/absmach/magistrala/internal/testsutil"
"github.com/absmach/supermq/bootstrap"
"github.com/absmach/supermq/bootstrap/postgres"
"github.com/absmach/supermq/pkg/errors"
repoerr "github.com/absmach/supermq/pkg/errors/repository"
"github.com/gofrs/uuid/v5"
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/postgres/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os"
"testing"

"github.com/absmach/supermq/bootstrap/postgres"
"github.com/absmach/magistrala/bootstrap/postgres"
smqlog "github.com/absmach/supermq/logger"
pgclient "github.com/absmach/supermq/pkg/postgres"
"github.com/jmoiron/sqlx"
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"net/http"
"testing"

"github.com/absmach/magistrala/bootstrap"
"github.com/absmach/supermq"
"github.com/absmach/supermq/bootstrap"
"github.com/absmach/supermq/pkg/errors"
"github.com/stretchr/testify/assert"
)
Expand Down
4 changes: 2 additions & 2 deletions bootstrap/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"sort"
"testing"

"github.com/absmach/magistrala/bootstrap"
"github.com/absmach/magistrala/bootstrap/mocks"
"github.com/absmach/magistrala/internal/testsutil"
"github.com/absmach/supermq/bootstrap"
"github.com/absmach/supermq/bootstrap/mocks"
smqauthn "github.com/absmach/supermq/pkg/authn"
"github.com/absmach/supermq/pkg/errors"
svcerr "github.com/absmach/supermq/pkg/errors/service"
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package tracing
import (
"context"

"github.com/absmach/supermq/bootstrap"
"github.com/absmach/magistrala/bootstrap"
smqauthn "github.com/absmach/supermq/pkg/authn"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"
Expand Down
14 changes: 7 additions & 7 deletions cmd/bootstrap/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import (
"os"

chclient "github.com/absmach/callhome/pkg/client"
"github.com/absmach/magistrala/bootstrap"
httpapi "github.com/absmach/magistrala/bootstrap/api"
"github.com/absmach/magistrala/bootstrap/events/consumer"
"github.com/absmach/magistrala/bootstrap/events/producer"
"github.com/absmach/magistrala/bootstrap/middleware"
bootstrappg "github.com/absmach/magistrala/bootstrap/postgres"
"github.com/absmach/magistrala/bootstrap/tracing"
"github.com/absmach/supermq"
"github.com/absmach/supermq/bootstrap"
httpapi "github.com/absmach/supermq/bootstrap/api"
"github.com/absmach/supermq/bootstrap/events/consumer"
"github.com/absmach/supermq/bootstrap/events/producer"
"github.com/absmach/supermq/bootstrap/middleware"
bootstrappg "github.com/absmach/supermq/bootstrap/postgres"
"github.com/absmach/supermq/bootstrap/tracing"
smqlog "github.com/absmach/supermq/logger"
authsvcAuthn "github.com/absmach/supermq/pkg/authn/authsvc"
smqauthz "github.com/absmach/supermq/pkg/authz"
Expand Down
2 changes: 1 addition & 1 deletion cmd/postgres-reader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"os"

chclient "github.com/absmach/callhome/pkg/client"
"github.com/absmach/magistrala/readers/postgres"
"github.com/absmach/supermq"
smqlog "github.com/absmach/supermq/logger"
"github.com/absmach/supermq/pkg/authn/authsvc"
Expand All @@ -23,7 +24,6 @@ import (
"github.com/absmach/supermq/pkg/uuid"
"github.com/absmach/supermq/readers"
httpapi "github.com/absmach/supermq/readers/api"
"github.com/absmach/supermq/readers/postgres"
"github.com/caarlos0/env/v11"
"github.com/jmoiron/sqlx"
"golang.org/x/sync/errgroup"
Expand Down
6 changes: 3 additions & 3 deletions cmd/postgres-writer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"os"

chclient "github.com/absmach/callhome/pkg/client"
consumertracing "github.com/absmach/magistrala/consumers/tracing"
httpapi "github.com/absmach/magistrala/consumers/writers/api"
writerpg "github.com/absmach/magistrala/consumers/writers/postgres"
"github.com/absmach/supermq"
"github.com/absmach/supermq/consumers"
consumertracing "github.com/absmach/supermq/consumers/tracing"
httpapi "github.com/absmach/supermq/consumers/writers/api"
writerpg "github.com/absmach/supermq/consumers/writers/postgres"
smqlog "github.com/absmach/supermq/logger"
jaegerclient "github.com/absmach/supermq/pkg/jaeger"
"github.com/absmach/supermq/pkg/messaging/brokers"
Expand Down
2 changes: 1 addition & 1 deletion cmd/timescale-reader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"os"

chclient "github.com/absmach/callhome/pkg/client"
"github.com/absmach/magistrala/readers/timescale"
"github.com/absmach/supermq"
smqlog "github.com/absmach/supermq/logger"
"github.com/absmach/supermq/pkg/authn/authsvc"
Expand All @@ -23,7 +24,6 @@ import (
"github.com/absmach/supermq/pkg/uuid"
"github.com/absmach/supermq/readers"
httpapi "github.com/absmach/supermq/readers/api"
"github.com/absmach/supermq/readers/timescale"
"github.com/caarlos0/env/v11"
"github.com/jmoiron/sqlx"
"golang.org/x/sync/errgroup"
Expand Down
6 changes: 3 additions & 3 deletions cmd/timescale-writer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"os"

chclient "github.com/absmach/callhome/pkg/client"
consumertracing "github.com/absmach/magistrala/consumers/tracing"
httpapi "github.com/absmach/magistrala/consumers/writers/api"
"github.com/absmach/magistrala/consumers/writers/timescale"
"github.com/absmach/supermq"
"github.com/absmach/supermq/consumers"
consumertracing "github.com/absmach/supermq/consumers/tracing"
httpapi "github.com/absmach/supermq/consumers/writers/api"
"github.com/absmach/supermq/consumers/writers/timescale"
smqlog "github.com/absmach/supermq/logger"
jaegerclient "github.com/absmach/supermq/pkg/jaeger"
"github.com/absmach/supermq/pkg/messaging/brokers"
Expand Down
4 changes: 2 additions & 2 deletions consumers/notifiers/api/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"strings"
"testing"

"github.com/absmach/magistrala/consumers/notifiers/api"
"github.com/absmach/magistrala/consumers/notifiers/mocks"
"github.com/absmach/magistrala/internal/testsutil"
apiutil "github.com/absmach/supermq/api/http/util"
"github.com/absmach/supermq/consumers/notifiers"
"github.com/absmach/supermq/consumers/notifiers/api"
"github.com/absmach/supermq/consumers/notifiers/mocks"
smqlog "github.com/absmach/supermq/logger"
svcerr "github.com/absmach/supermq/pkg/errors/service"
"github.com/absmach/supermq/pkg/uuid"
Expand Down
22 changes: 0 additions & 22 deletions consumers/notifiers/notifier.go

This file was deleted.

2 changes: 1 addition & 1 deletion consumers/notifiers/postgres/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"os"
"testing"

"github.com/absmach/supermq/consumers/notifiers/postgres"
"github.com/absmach/magistrala/consumers/notifiers/postgres"
pgclient "github.com/absmach/supermq/pkg/postgres"
"github.com/absmach/supermq/pkg/ulid"
_ "github.com/jackc/pgx/v5/stdlib" // required for SQL access
Expand Down
2 changes: 1 addition & 1 deletion consumers/notifiers/postgres/subscriptions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"testing"

"github.com/absmach/magistrala/consumers/notifiers/postgres"
"github.com/absmach/supermq/consumers/notifiers"
"github.com/absmach/supermq/consumers/notifiers/postgres"
"github.com/absmach/supermq/pkg/errors"
repoerr "github.com/absmach/supermq/pkg/errors/repository"
"github.com/stretchr/testify/assert"
Expand Down
Loading

0 comments on commit 5200ca5

Please sign in to comment.