Skip to content

Commit a62c9b5

Browse files
committed
feat(api,cli): delete mongo store
1 parent 9daba0a commit a62c9b5

File tree

240 files changed

+8
-25597
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+8
-25597
lines changed

api/pkg/echo/handlers/errors.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
routes "github.com/shellhub-io/shellhub/api/routes/errors"
1111
"github.com/shellhub-io/shellhub/api/services"
1212
"github.com/shellhub-io/shellhub/api/store"
13-
"github.com/shellhub-io/shellhub/api/store/mongo"
1413
"github.com/shellhub-io/shellhub/pkg/errors"
1514
)
1615

@@ -38,12 +37,12 @@ func NewErrors(reporter *sentry.Client) func(error, echo.Context) {
3837

3938
// Every Mongo error that isn't mapped as a store error must be reported to Sentry and responded with HTTP
4039
// status code 500.
41-
if errors.Is(err, mongo.ErrMongo) {
42-
report(reporter, err, ctx.Request())
43-
ctx.NoContent(http.StatusInternalServerError) //nolint:errcheck
44-
45-
return
46-
}
40+
// if errors.Is(err, mongo.ErrMongo) { // TODO: generic error
41+
// report(reporter, err, ctx.Request())
42+
// ctx.NoContent(http.StatusInternalServerError) //nolint:errcheck
43+
//
44+
// return
45+
// }
4746

4847
// On HTTP errors, anything related to the HTTP protocol, we just return the error code, avoiding a 500 error.
4948
var herr *echo.HTTPError

api/services/member.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"time"
88

99
"github.com/shellhub-io/shellhub/api/store"
10-
"github.com/shellhub-io/shellhub/api/store/mongo"
1110
"github.com/shellhub-io/shellhub/pkg/api/authorizer"
1211
"github.com/shellhub-io/shellhub/pkg/api/requests"
1312
"github.com/shellhub-io/shellhub/pkg/clock"
@@ -276,8 +275,8 @@ func (s *service) removeMember(ctx context.Context, ns *models.Namespace, userID
276275
switch {
277276
case errors.Is(err, store.ErrNoDocuments):
278277
return NewErrNamespaceNotFound(ns.TenantID, err)
279-
case errors.Is(err, mongo.ErrUserNotFound):
280-
return NewErrNamespaceMemberNotFound(userID, err)
278+
// case errors.Is(err, mongo.ErrUserNotFound): // TODO: generic error
279+
// return NewErrNamespaceMemberNotFound(userID, err)
281280
default:
282281
return err
283282
}

api/store/mongo/api-key.go

Lines changed: 0 additions & 154 deletions
This file was deleted.

0 commit comments

Comments
 (0)