Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove common handlers.Interface #3753

Merged
merged 2 commits into from
Nov 23, 2023
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
9 changes: 4 additions & 5 deletions internal/clientconn/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@

noisersup marked this conversation as resolved.
Show resolved Hide resolved
"github.com/FerretDB/FerretDB/internal/clientconn/conninfo"
"github.com/FerretDB/FerretDB/internal/clientconn/connmetrics"
"github.com/FerretDB/FerretDB/internal/handlers"
"github.com/FerretDB/FerretDB/internal/handlers/commoncommands"
"github.com/FerretDB/FerretDB/internal/handlers/commonerrors"
"github.com/FerretDB/FerretDB/internal/handlers/proxy"
handler "github.com/FerretDB/FerretDB/internal/handlers/sqlite"
"github.com/FerretDB/FerretDB/internal/types"
"github.com/FerretDB/FerretDB/internal/util/lazyerrors"
"github.com/FerretDB/FerretDB/internal/util/must"
Expand Down Expand Up @@ -76,7 +75,7 @@
netConn net.Conn
mode Mode
l *zap.SugaredLogger
h handlers.Interface
h *handler.Handler
m *connmetrics.ConnMetrics
proxy *proxy.Router
lastRequestID atomic.Int32
Expand All @@ -88,7 +87,7 @@
netConn net.Conn
mode Mode
l *zap.Logger
handler handlers.Interface
handler *handler.Handler
connMetrics *connmetrics.ConnMetrics
proxyAddr string
testRecordsDir string // if empty, no records are created
Expand Down Expand Up @@ -556,7 +555,7 @@
//
// The passed context is canceled when the client disconnects.
func (c *conn) handleOpMsg(ctx context.Context, msg *wire.OpMsg, command string) (*wire.OpMsg, error) {
if cmd, ok := commoncommands.Commands[command]; ok {
if cmd, ok := handler.Commands[command]; ok {

Check warning on line 558 in internal/clientconn/conn.go

View check run for this annotation

Codecov / codecov/patch

internal/clientconn/conn.go#L558

Added line #L558 was not covered by tests
if cmd.Handler != nil {
defer observability.FuncCall(ctx)()

Expand Down
4 changes: 2 additions & 2 deletions internal/clientconn/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"go.uber.org/zap"

"github.com/FerretDB/FerretDB/internal/clientconn/connmetrics"
"github.com/FerretDB/FerretDB/internal/handlers"
handler "github.com/FerretDB/FerretDB/internal/handlers/sqlite"
"github.com/FerretDB/FerretDB/internal/util/ctxutil"
"github.com/FerretDB/FerretDB/internal/util/lazyerrors"
"github.com/FerretDB/FerretDB/internal/wire"
Expand Down Expand Up @@ -63,7 +63,7 @@ type NewListenerOpts struct {
ProxyAddr string
Mode Mode
Metrics *connmetrics.ListenerMetrics
Handler handlers.Interface
Handler *handler.Handler
Logger *zap.Logger
TestRecordsDir string // if empty, no records are created
}
Expand Down
265 changes: 0 additions & 265 deletions internal/handlers/commoncommands/msg_listcommands.go

This file was deleted.

Loading
Loading