Rehuffle where things are in the internal package (#1122)

renamed:    internal/eventcontent.go -> internal/eventutil/eventcontent.go
	renamed:    internal/events.go -> internal/eventutil/events.go
	renamed:    internal/types.go -> internal/eventutil/types.go
	renamed:    internal/http/http.go -> internal/httputil/http.go
	renamed:    internal/httpapi.go -> internal/httputil/httpapi.go
	renamed:    internal/httpapi_test.go -> internal/httputil/httpapi_test.go
	renamed:    internal/httpapis/paths.go -> internal/httputil/paths.go
	renamed:    internal/routing.go -> internal/httputil/routing.go
	renamed:    internal/basecomponent/base.go -> internal/setup/base.go
	renamed:    internal/basecomponent/flags.go -> internal/setup/flags.go
	renamed:    internal/partition_offset_table.go -> internal/sqlutil/partition_offset_table.go
	renamed:    internal/postgres.go -> internal/sqlutil/postgres.go
	renamed:    internal/postgres_wasm.go -> internal/sqlutil/postgres_wasm.go
	renamed:    internal/sql.go -> internal/sqlutil/sql.go
This commit is contained in:
Kegsay 2020-06-12 14:55:57 +01:00 committed by GitHub
parent 4675e1ddb6
commit ecd7accbad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
159 changed files with 784 additions and 693 deletions

View file

@ -21,7 +21,7 @@ import (
"errors"
"fmt"
"github.com/matrix-org/dendrite/internal"
"github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/dendrite/roomserver/state"
"github.com/matrix-org/dendrite/roomserver/storage"
@ -177,7 +177,7 @@ func (r *RoomserverInternalAPI) processInviteEvent(
}
succeeded := false
defer func() {
txerr := internal.EndTransaction(updater, &succeeded)
txerr := sqlutil.EndTransaction(updater, &succeeded)
if err == nil && txerr != nil {
err = txerr
}

View file

@ -21,7 +21,7 @@ import (
"context"
"fmt"
"github.com/matrix-org/dendrite/internal"
"github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/dendrite/roomserver/state"
"github.com/matrix-org/dendrite/roomserver/types"
@ -60,7 +60,7 @@ func (r *RoomserverInternalAPI) updateLatestEvents(
}
succeeded := false
defer func() {
txerr := internal.EndTransaction(updater, &succeeded)
txerr := sqlutil.EndTransaction(updater, &succeeded)
if err == nil && txerr != nil {
err = txerr
}

View file

@ -7,7 +7,7 @@ import (
"time"
fsAPI "github.com/matrix-org/dendrite/federationsender/api"
"github.com/matrix-org/dendrite/internal"
"github.com/matrix-org/dendrite/internal/eventutil"
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/gomatrixserverlib"
"github.com/sirupsen/logrus"
@ -159,7 +159,7 @@ func (r *RoomserverInternalAPI) performJoinRoomByID(
// TODO: Check what happens if the room exists on the server
// but everyone has since left. I suspect it does the wrong thing.
buildRes := api.QueryLatestEventsAndStateResponse{}
event, err := internal.BuildEvent(
event, err := eventutil.BuildEvent(
ctx, // the request context
&eb, // the template join event
r.Cfg, // the server configuration
@ -202,7 +202,7 @@ func (r *RoomserverInternalAPI) performJoinRoomByID(
}
}
case internal.ErrRoomNoExists:
case eventutil.ErrRoomNoExists:
// The room doesn't exist. First of all check if the room is a local
// room. If it is then there's nothing more to do - the room just
// hasn't been created yet.

View file

@ -7,7 +7,7 @@ import (
"time"
fsAPI "github.com/matrix-org/dendrite/federationsender/api"
"github.com/matrix-org/dendrite/internal"
"github.com/matrix-org/dendrite/internal/eventutil"
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/gomatrixserverlib"
)
@ -97,7 +97,7 @@ func (r *RoomserverInternalAPI) performLeaveRoomByID(
// TODO: Check what happens if the room exists on the server
// but everyone has since left. I suspect it does the wrong thing.
buildRes := api.QueryLatestEventsAndStateResponse{}
event, err := internal.BuildEvent(
event, err := eventutil.BuildEvent(
ctx, // the request context
&eb, // the template leave event
r.Cfg, // the server configuration
@ -106,7 +106,7 @@ func (r *RoomserverInternalAPI) performLeaveRoomByID(
&buildRes, // the query response
)
if err != nil {
return fmt.Errorf("internal.BuildEvent: %w", err)
return fmt.Errorf("eventutil.BuildEvent: %w", err)
}
// Give our leave event to the roomserver input stream. The