Skip to content

Commit a2df84a

Browse files
committed
feat(api,cli): delete mongo store
1 parent c79919c commit a2df84a

File tree

242 files changed

+0
-25740
lines changed

Some content is hidden

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

242 files changed

+0
-25740
lines changed

api/pkg/echo/handlers/errors.go

Lines changed: 0 additions & 10 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

@@ -36,15 +35,6 @@ func NewErrors(reporter *sentry.Client) func(error, echo.Context) {
3635
// happens in each case, avoiding the use of else statements, which would make the code more confusing or a big
3736
// switch statement, which would make the code less readable.
3837

39-
// Every Mongo error that isn't mapped as a store error must be reported to Sentry and responded with HTTP
40-
// 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-
}
47-
4838
// On HTTP errors, anything related to the HTTP protocol, we just return the error code, avoiding a 500 error.
4939
var herr *echo.HTTPError
5040
if ok := errors.As(err, &herr); ok {

api/services/member.go

Lines changed: 0 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,6 @@ 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)
281278
default:
282279
return err
283280
}

api/store/mongo/api-key.go

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

0 commit comments

Comments
 (0)