aboutsummaryrefslogtreecommitdiff
path: root/appservice
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-05-21 14:40:13 +0100
committerGitHub <noreply@github.com>2020-05-21 14:40:13 +0100
commit24d8df664c21fa8bd68d80b5585a496e264c410a (patch)
tree0a176d6dfd7f81522c5739b53313366b552b0ce1 /appservice
parent3fdb045116c9cd2f2a3badfebec0645d0381bacb (diff)
Fix #897 and shuffle directory around (#1054)
* Fix #897 and shuffle directory around * Update find-lint * goimports Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Diffstat (limited to 'appservice')
-rw-r--r--appservice/api/query.go10
-rw-r--r--appservice/appservice.go6
-rw-r--r--appservice/consumers/roomserver.go8
-rw-r--r--appservice/query/query.go8
-rw-r--r--appservice/routing/routing.go10
-rw-r--r--appservice/storage/postgres/storage.go4
-rw-r--r--appservice/storage/sqlite3/storage.go4
-rw-r--r--appservice/storage/storage.go4
-rw-r--r--appservice/storage/storage_wasm.go4
-rw-r--r--appservice/types/types.go2
-rw-r--r--appservice/workers/transaction_scheduler.go2
11 files changed, 31 insertions, 31 deletions
diff --git a/appservice/api/query.go b/appservice/api/query.go
index afd5c5d7..4a4e31a9 100644
--- a/appservice/api/query.go
+++ b/appservice/api/query.go
@@ -27,8 +27,8 @@ import (
"github.com/matrix-org/dendrite/clientapi/auth/storage/accounts"
"github.com/matrix-org/gomatrixserverlib"
- "github.com/matrix-org/dendrite/common"
- commonHTTP "github.com/matrix-org/dendrite/common/http"
+ "github.com/matrix-org/dendrite/internal"
+ internalHTTP "github.com/matrix-org/dendrite/internal/http"
opentracing "github.com/opentracing/opentracing-go"
)
@@ -119,7 +119,7 @@ func (h *httpAppServiceQueryAPI) RoomAliasExists(
defer span.Finish()
apiURL := h.appserviceURL + AppServiceRoomAliasExistsPath
- return commonHTTP.PostJSON(ctx, span, h.httpClient, apiURL, request, response)
+ return internalHTTP.PostJSON(ctx, span, h.httpClient, apiURL, request, response)
}
// UserIDExists implements AppServiceQueryAPI
@@ -132,7 +132,7 @@ func (h *httpAppServiceQueryAPI) UserIDExists(
defer span.Finish()
apiURL := h.appserviceURL + AppServiceUserIDExistsPath
- return commonHTTP.PostJSON(ctx, span, h.httpClient, apiURL, request, response)
+ return internalHTTP.PostJSON(ctx, span, h.httpClient, apiURL, request, response)
}
// RetrieveUserProfile is a wrapper that queries both the local database and
@@ -165,7 +165,7 @@ func RetrieveUserProfile(
// If no user exists, return
if !userResp.UserIDExists {
- return nil, common.ErrProfileNoExists
+ return nil, internal.ErrProfileNoExists
}
// Try to query the user from the local database again
diff --git a/appservice/appservice.go b/appservice/appservice.go
index 3a1c4677..3c67ce9c 100644
--- a/appservice/appservice.go
+++ b/appservice/appservice.go
@@ -29,9 +29,9 @@ import (
"github.com/matrix-org/dendrite/appservice/workers"
"github.com/matrix-org/dendrite/clientapi/auth/storage/accounts"
"github.com/matrix-org/dendrite/clientapi/auth/storage/devices"
- "github.com/matrix-org/dendrite/common/basecomponent"
- "github.com/matrix-org/dendrite/common/config"
- "github.com/matrix-org/dendrite/common/transactions"
+ "github.com/matrix-org/dendrite/internal/basecomponent"
+ "github.com/matrix-org/dendrite/internal/config"
+ "github.com/matrix-org/dendrite/internal/transactions"
roomserverAPI "github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/gomatrixserverlib"
"github.com/sirupsen/logrus"
diff --git a/appservice/consumers/roomserver.go b/appservice/consumers/roomserver.go
index b7f68924..bb4df790 100644
--- a/appservice/consumers/roomserver.go
+++ b/appservice/consumers/roomserver.go
@@ -21,8 +21,8 @@ import (
"github.com/matrix-org/dendrite/appservice/storage"
"github.com/matrix-org/dendrite/appservice/types"
"github.com/matrix-org/dendrite/clientapi/auth/storage/accounts"
- "github.com/matrix-org/dendrite/common"
- "github.com/matrix-org/dendrite/common/config"
+ "github.com/matrix-org/dendrite/internal"
+ "github.com/matrix-org/dendrite/internal/config"
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/gomatrixserverlib"
@@ -32,7 +32,7 @@ import (
// OutputRoomEventConsumer consumes events that originated in the room server.
type OutputRoomEventConsumer struct {
- roomServerConsumer *common.ContinualConsumer
+ roomServerConsumer *internal.ContinualConsumer
db accounts.Database
asDB storage.Database
rsAPI api.RoomserverInternalAPI
@@ -50,7 +50,7 @@ func NewOutputRoomEventConsumer(
rsAPI api.RoomserverInternalAPI,
workerStates []types.ApplicationServiceWorkerState,
) *OutputRoomEventConsumer {
- consumer := common.ContinualConsumer{
+ consumer := internal.ContinualConsumer{
Topic: string(cfg.Kafka.Topics.OutputRoomEvent),
Consumer: kafkaConsumer,
PartitionStore: store,
diff --git a/appservice/query/query.go b/appservice/query/query.go
index fde3ab09..a61997b4 100644
--- a/appservice/query/query.go
+++ b/appservice/query/query.go
@@ -24,8 +24,8 @@ import (
"time"
"github.com/matrix-org/dendrite/appservice/api"
- "github.com/matrix-org/dendrite/common"
- "github.com/matrix-org/dendrite/common/config"
+ "github.com/matrix-org/dendrite/internal"
+ "github.com/matrix-org/dendrite/internal/config"
"github.com/matrix-org/util"
opentracing "github.com/opentracing/opentracing-go"
log "github.com/sirupsen/logrus"
@@ -185,7 +185,7 @@ func makeHTTPClient() *http.Client {
func (a *AppServiceQueryAPI) SetupHTTP(servMux *http.ServeMux) {
servMux.Handle(
api.AppServiceRoomAliasExistsPath,
- common.MakeInternalAPI("appserviceRoomAliasExists", func(req *http.Request) util.JSONResponse {
+ internal.MakeInternalAPI("appserviceRoomAliasExists", func(req *http.Request) util.JSONResponse {
var request api.RoomAliasExistsRequest
var response api.RoomAliasExistsResponse
if err := json.NewDecoder(req.Body).Decode(&request); err != nil {
@@ -199,7 +199,7 @@ func (a *AppServiceQueryAPI) SetupHTTP(servMux *http.ServeMux) {
)
servMux.Handle(
api.AppServiceUserIDExistsPath,
- common.MakeInternalAPI("appserviceUserIDExists", func(req *http.Request) util.JSONResponse {
+ internal.MakeInternalAPI("appserviceUserIDExists", func(req *http.Request) util.JSONResponse {
var request api.UserIDExistsRequest
var response api.UserIDExistsResponse
if err := json.NewDecoder(req.Body).Decode(&request); err != nil {
diff --git a/appservice/routing/routing.go b/appservice/routing/routing.go
index 9f59e05f..ac1ff32e 100644
--- a/appservice/routing/routing.go
+++ b/appservice/routing/routing.go
@@ -19,9 +19,9 @@ import (
"github.com/gorilla/mux"
"github.com/matrix-org/dendrite/clientapi/auth/storage/accounts"
- "github.com/matrix-org/dendrite/common"
- "github.com/matrix-org/dendrite/common/config"
- "github.com/matrix-org/dendrite/common/transactions"
+ "github.com/matrix-org/dendrite/internal"
+ "github.com/matrix-org/dendrite/internal/config"
+ "github.com/matrix-org/dendrite/internal/transactions"
"github.com/matrix-org/dendrite/roomserver/api"
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/util"
@@ -45,7 +45,7 @@ func Setup(
appMux := apiMux.PathPrefix(pathPrefixApp).Subrouter()
appMux.Handle("/alias",
- common.MakeExternalAPI("alias", func(req *http.Request) util.JSONResponse {
+ internal.MakeExternalAPI("alias", func(req *http.Request) util.JSONResponse {
// TODO: Implement
return util.JSONResponse{
Code: http.StatusOK,
@@ -54,7 +54,7 @@ func Setup(
}),
).Methods(http.MethodGet, http.MethodOptions)
appMux.Handle("/user",
- common.MakeExternalAPI("user", func(req *http.Request) util.JSONResponse {
+ internal.MakeExternalAPI("user", func(req *http.Request) util.JSONResponse {
// TODO: Implement
return util.JSONResponse{
Code: http.StatusOK,
diff --git a/appservice/storage/postgres/storage.go b/appservice/storage/postgres/storage.go
index 475db6fc..aeead6ed 100644
--- a/appservice/storage/postgres/storage.go
+++ b/appservice/storage/postgres/storage.go
@@ -21,7 +21,7 @@ import (
// Import postgres database driver
_ "github.com/lib/pq"
- "github.com/matrix-org/dendrite/common"
+ "github.com/matrix-org/dendrite/internal"
"github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/gomatrixserverlib"
)
@@ -34,7 +34,7 @@ type Database struct {
}
// NewDatabase opens a new database
-func NewDatabase(dataSourceName string, dbProperties common.DbProperties) (*Database, error) {
+func NewDatabase(dataSourceName string, dbProperties internal.DbProperties) (*Database, error) {
var result Database
var err error
if result.db, err = sqlutil.Open("postgres", dataSourceName, dbProperties); err != nil {
diff --git a/appservice/storage/sqlite3/storage.go b/appservice/storage/sqlite3/storage.go
index 0b0590f6..275c6652 100644
--- a/appservice/storage/sqlite3/storage.go
+++ b/appservice/storage/sqlite3/storage.go
@@ -20,7 +20,7 @@ import (
"database/sql"
// Import SQLite database driver
- "github.com/matrix-org/dendrite/common"
+ "github.com/matrix-org/dendrite/internal"
"github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/gomatrixserverlib"
_ "github.com/mattn/go-sqlite3"
@@ -37,7 +37,7 @@ type Database struct {
func NewDatabase(dataSourceName string) (*Database, error) {
var result Database
var err error
- if result.db, err = sqlutil.Open(common.SQLiteDriverName(), dataSourceName, nil); err != nil {
+ if result.db, err = sqlutil.Open(internal.SQLiteDriverName(), dataSourceName, nil); err != nil {
return nil, err
}
if err = result.prepare(); err != nil {
diff --git a/appservice/storage/storage.go b/appservice/storage/storage.go
index bf0a9b0c..51ba1de5 100644
--- a/appservice/storage/storage.go
+++ b/appservice/storage/storage.go
@@ -21,12 +21,12 @@ import (
"github.com/matrix-org/dendrite/appservice/storage/postgres"
"github.com/matrix-org/dendrite/appservice/storage/sqlite3"
- "github.com/matrix-org/dendrite/common"
+ "github.com/matrix-org/dendrite/internal"
)
// NewDatabase opens a new Postgres or Sqlite database (based on dataSourceName scheme)
// and sets DB connection parameters
-func NewDatabase(dataSourceName string, dbProperties common.DbProperties) (Database, error) {
+func NewDatabase(dataSourceName string, dbProperties internal.DbProperties) (Database, error) {
uri, err := url.Parse(dataSourceName)
if err != nil {
return postgres.NewDatabase(dataSourceName, dbProperties)
diff --git a/appservice/storage/storage_wasm.go b/appservice/storage/storage_wasm.go
index ff0330ae..a6144b43 100644
--- a/appservice/storage/storage_wasm.go
+++ b/appservice/storage/storage_wasm.go
@@ -19,12 +19,12 @@ import (
"net/url"
"github.com/matrix-org/dendrite/appservice/storage/sqlite3"
- "github.com/matrix-org/dendrite/common"
+ "github.com/matrix-org/dendrite/internal"
)
func NewDatabase(
dataSourceName string,
- dbProperties common.DbProperties, // nolint:unparam
+ dbProperties internal.DbProperties, // nolint:unparam
) (Database, error) {
uri, err := url.Parse(dataSourceName)
if err != nil {
diff --git a/appservice/types/types.go b/appservice/types/types.go
index aac73155..b6386df6 100644
--- a/appservice/types/types.go
+++ b/appservice/types/types.go
@@ -15,7 +15,7 @@ package types
import (
"sync"
- "github.com/matrix-org/dendrite/common/config"
+ "github.com/matrix-org/dendrite/internal/config"
)
const (
diff --git a/appservice/workers/transaction_scheduler.go b/appservice/workers/transaction_scheduler.go
index 10c7ef91..20805619 100644
--- a/appservice/workers/transaction_scheduler.go
+++ b/appservice/workers/transaction_scheduler.go
@@ -25,7 +25,7 @@ import (
"github.com/matrix-org/dendrite/appservice/storage"
"github.com/matrix-org/dendrite/appservice/types"
- "github.com/matrix-org/dendrite/common/config"
+ "github.com/matrix-org/dendrite/internal/config"
"github.com/matrix-org/gomatrixserverlib"
log "github.com/sirupsen/logrus"
)