From 5ab8e8caf27292fe8ddeb90f926c46d1c39e7313 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 30 Mar 2020 12:56:04 +0100 Subject: [PATCH] Blunt move and sed rename --- clientapi/clientapi.go | 2 +- clientapi/producers/typingserver.go | 2 +- cmd/dendrite-client-api-server/main.go | 6 +++--- cmd/dendrite-monolith-server/main.go | 6 +++--- cmd/dendrite-typing-server/main.go | 6 +++--- cmd/dendritejs/main.go | 6 +++--- common/basecomponent/base.go | 2 +- common/config/config.go | 2 +- {typingserver => eduserver}/api/input.go | 2 +- {typingserver => eduserver}/api/output.go | 0 {typingserver => eduserver}/cache/cache.go | 0 {typingserver => eduserver}/cache/cache_test.go | 0 typingserver/typingserver.go => eduserver/eduserver.go | 8 ++++---- {typingserver => eduserver}/input/input.go | 4 ++-- federationsender/consumers/typingserver.go | 4 ++-- syncapi/consumers/typingserver.go | 2 +- syncapi/storage/interface.go | 2 +- syncapi/storage/postgres/syncserver.go | 2 +- syncapi/storage/sqlite3/syncserver.go | 2 +- 19 files changed, 29 insertions(+), 29 deletions(-) rename {typingserver => eduserver}/api/input.go (97%) rename {typingserver => eduserver}/api/output.go (100%) rename {typingserver => eduserver}/cache/cache.go (100%) rename {typingserver => eduserver}/cache/cache_test.go (100%) rename typingserver/typingserver.go => eduserver/eduserver.go (88%) rename {typingserver => eduserver}/input/input.go (96%) diff --git a/clientapi/clientapi.go b/clientapi/clientapi.go index e608b69f3..8ac8f9449 100644 --- a/clientapi/clientapi.go +++ b/clientapi/clientapi.go @@ -25,7 +25,7 @@ import ( "github.com/matrix-org/dendrite/common/transactions" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" - typingServerAPI "github.com/matrix-org/dendrite/typingserver/api" + typingServerAPI "github.com/matrix-org/dendrite/eduserver/api" "github.com/matrix-org/gomatrixserverlib" "github.com/sirupsen/logrus" ) diff --git a/clientapi/producers/typingserver.go b/clientapi/producers/typingserver.go index f4d0bcba7..36cfaa967 100644 --- a/clientapi/producers/typingserver.go +++ b/clientapi/producers/typingserver.go @@ -16,7 +16,7 @@ import ( "context" "time" - "github.com/matrix-org/dendrite/typingserver/api" + "github.com/matrix-org/dendrite/eduserver/api" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/cmd/dendrite-client-api-server/main.go b/cmd/dendrite-client-api-server/main.go index 2bde0f4cf..77032aea9 100644 --- a/cmd/dendrite-client-api-server/main.go +++ b/cmd/dendrite-client-api-server/main.go @@ -19,8 +19,8 @@ import ( "github.com/matrix-org/dendrite/common/basecomponent" "github.com/matrix-org/dendrite/common/keydb" "github.com/matrix-org/dendrite/common/transactions" - "github.com/matrix-org/dendrite/typingserver" - "github.com/matrix-org/dendrite/typingserver/cache" + "github.com/matrix-org/dendrite/eduserver" + "github.com/matrix-org/dendrite/eduserver/cache" ) func main() { @@ -38,7 +38,7 @@ func main() { asQuery := base.CreateHTTPAppServiceAPIs() alias, input, query := base.CreateHTTPRoomserverAPIs() fedSenderAPI := base.CreateHTTPFederationSenderAPIs() - typingInputAPI := typingserver.SetupTypingServerComponent(base, cache.NewTypingCache()) + typingInputAPI := eduserver.SetupTypingServerComponent(base, cache.NewTypingCache()) clientapi.SetupClientAPIComponent( base, deviceDB, accountDB, federation, &keyRing, diff --git a/cmd/dendrite-monolith-server/main.go b/cmd/dendrite-monolith-server/main.go index 27c3054b8..5e0b5050b 100644 --- a/cmd/dendrite-monolith-server/main.go +++ b/cmd/dendrite-monolith-server/main.go @@ -24,14 +24,14 @@ import ( "github.com/matrix-org/dendrite/common/basecomponent" "github.com/matrix-org/dendrite/common/keydb" "github.com/matrix-org/dendrite/common/transactions" + "github.com/matrix-org/dendrite/eduserver" + "github.com/matrix-org/dendrite/eduserver/cache" "github.com/matrix-org/dendrite/federationapi" "github.com/matrix-org/dendrite/federationsender" "github.com/matrix-org/dendrite/mediaapi" "github.com/matrix-org/dendrite/publicroomsapi" "github.com/matrix-org/dendrite/roomserver" "github.com/matrix-org/dendrite/syncapi" - "github.com/matrix-org/dendrite/typingserver" - "github.com/matrix-org/dendrite/typingserver/cache" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/sirupsen/logrus" @@ -56,7 +56,7 @@ func main() { keyRing := keydb.CreateKeyRing(federation.Client, keyDB) alias, input, query := roomserver.SetupRoomServerComponent(base) - typingInputAPI := typingserver.SetupTypingServerComponent(base, cache.NewTypingCache()) + typingInputAPI := eduserver.SetupTypingServerComponent(base, cache.NewTypingCache()) asQuery := appservice.SetupAppServiceAPIComponent( base, accountDB, deviceDB, federation, alias, query, transactions.New(), ) diff --git a/cmd/dendrite-typing-server/main.go b/cmd/dendrite-typing-server/main.go index 461eb7144..0be9acc96 100644 --- a/cmd/dendrite-typing-server/main.go +++ b/cmd/dendrite-typing-server/main.go @@ -16,8 +16,8 @@ import ( _ "net/http/pprof" "github.com/matrix-org/dendrite/common/basecomponent" - "github.com/matrix-org/dendrite/typingserver" - "github.com/matrix-org/dendrite/typingserver/cache" + "github.com/matrix-org/dendrite/eduserver" + "github.com/matrix-org/dendrite/eduserver/cache" "github.com/sirupsen/logrus" ) @@ -30,7 +30,7 @@ func main() { } }() - typingserver.SetupTypingServerComponent(base, cache.NewTypingCache()) + eduserver.SetupTypingServerComponent(base, cache.NewTypingCache()) base.SetupAndServeHTTP(string(base.Cfg.Bind.TypingServer), string(base.Cfg.Listen.TypingServer)) diff --git a/cmd/dendritejs/main.go b/cmd/dendritejs/main.go index 7c8526715..35bdb5384 100644 --- a/cmd/dendritejs/main.go +++ b/cmd/dendritejs/main.go @@ -33,8 +33,8 @@ import ( "github.com/matrix-org/dendrite/publicroomsapi" "github.com/matrix-org/dendrite/roomserver" "github.com/matrix-org/dendrite/syncapi" - "github.com/matrix-org/dendrite/typingserver" - "github.com/matrix-org/dendrite/typingserver/cache" + "github.com/matrix-org/dendrite/eduserver" + "github.com/matrix-org/dendrite/eduserver/cache" "github.com/matrix-org/go-http-js-libp2p/go_http_js_libp2p" "github.com/matrix-org/gomatrixserverlib" @@ -122,7 +122,7 @@ func main() { p2pPublicRoomProvider := NewLibP2PPublicRoomsProvider(node) alias, input, query := roomserver.SetupRoomServerComponent(base) - typingInputAPI := typingserver.SetupTypingServerComponent(base, cache.NewTypingCache()) + typingInputAPI := eduserver.SetupTypingServerComponent(base, cache.NewTypingCache()) asQuery := appservice.SetupAppServiceAPIComponent( base, accountDB, deviceDB, federation, alias, query, transactions.New(), ) diff --git a/common/basecomponent/base.go b/common/basecomponent/base.go index d1d953f7b..592ddc182 100644 --- a/common/basecomponent/base.go +++ b/common/basecomponent/base.go @@ -37,7 +37,7 @@ import ( "github.com/matrix-org/dendrite/common/config" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" - typingServerAPI "github.com/matrix-org/dendrite/typingserver/api" + typingServerAPI "github.com/matrix-org/dendrite/eduserver/api" "github.com/sirupsen/logrus" ) diff --git a/common/config/config.go b/common/config/config.go index bd83cbf8b..10bd4fee9 100644 --- a/common/config/config.go +++ b/common/config/config.go @@ -134,7 +134,7 @@ type Dendrite struct { OutputRoomEvent Topic `yaml:"output_room_event"` // Topic for sending account data from client API to sync API OutputClientData Topic `yaml:"output_client_data"` - // Topic for typingserver/api.OutputTypingEvent events. + // Topic for eduserver/api.OutputTypingEvent events. OutputTypingEvent Topic `yaml:"output_typing_event"` // Topic for user updates (profile, presence) UserUpdates Topic `yaml:"user_updates"` diff --git a/typingserver/api/input.go b/eduserver/api/input.go similarity index 97% rename from typingserver/api/input.go rename to eduserver/api/input.go index 25e2ea228..ae9e3c5ca 100644 --- a/typingserver/api/input.go +++ b/eduserver/api/input.go @@ -54,7 +54,7 @@ type TypingServerInputAPI interface { } // TypingServerInputTypingEventPath is the HTTP path for the InputTypingEvent API. -const TypingServerInputTypingEventPath = "/api/typingserver/input" +const TypingServerInputTypingEventPath = "/api/eduserver/input" // NewTypingServerInputAPIHTTP creates a TypingServerInputAPI implemented by talking to a HTTP POST API. func NewTypingServerInputAPIHTTP(typingServerURL string, httpClient *http.Client) TypingServerInputAPI { diff --git a/typingserver/api/output.go b/eduserver/api/output.go similarity index 100% rename from typingserver/api/output.go rename to eduserver/api/output.go diff --git a/typingserver/cache/cache.go b/eduserver/cache/cache.go similarity index 100% rename from typingserver/cache/cache.go rename to eduserver/cache/cache.go diff --git a/typingserver/cache/cache_test.go b/eduserver/cache/cache_test.go similarity index 100% rename from typingserver/cache/cache_test.go rename to eduserver/cache/cache_test.go diff --git a/typingserver/typingserver.go b/eduserver/eduserver.go similarity index 88% rename from typingserver/typingserver.go rename to eduserver/eduserver.go index b43f72f75..c7b97dc7a 100644 --- a/typingserver/typingserver.go +++ b/eduserver/eduserver.go @@ -10,15 +10,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -package typingserver +package eduserver import ( "net/http" "github.com/matrix-org/dendrite/common/basecomponent" - "github.com/matrix-org/dendrite/typingserver/api" - "github.com/matrix-org/dendrite/typingserver/cache" - "github.com/matrix-org/dendrite/typingserver/input" + "github.com/matrix-org/dendrite/eduserver/api" + "github.com/matrix-org/dendrite/eduserver/cache" + "github.com/matrix-org/dendrite/eduserver/input" ) // SetupTypingServerComponent sets up and registers HTTP handlers for the diff --git a/typingserver/input/input.go b/eduserver/input/input.go similarity index 96% rename from typingserver/input/input.go rename to eduserver/input/input.go index 0e2fbe51f..6ad1b8830 100644 --- a/typingserver/input/input.go +++ b/eduserver/input/input.go @@ -19,8 +19,8 @@ import ( "time" "github.com/matrix-org/dendrite/common" - "github.com/matrix-org/dendrite/typingserver/api" - "github.com/matrix-org/dendrite/typingserver/cache" + "github.com/matrix-org/dendrite/eduserver/api" + "github.com/matrix-org/dendrite/eduserver/cache" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" "gopkg.in/Shopify/sarama.v1" diff --git a/federationsender/consumers/typingserver.go b/federationsender/consumers/typingserver.go index 590fcb257..16021ff56 100644 --- a/federationsender/consumers/typingserver.go +++ b/federationsender/consumers/typingserver.go @@ -20,7 +20,7 @@ import ( "github.com/matrix-org/dendrite/common/config" "github.com/matrix-org/dendrite/federationsender/queue" "github.com/matrix-org/dendrite/federationsender/storage" - "github.com/matrix-org/dendrite/typingserver/api" + "github.com/matrix-org/dendrite/eduserver/api" "github.com/matrix-org/gomatrixserverlib" log "github.com/sirupsen/logrus" "gopkg.in/Shopify/sarama.v1" @@ -69,7 +69,7 @@ func (t *OutputTypingEventConsumer) onMessage(msg *sarama.ConsumerMessage) error var ote api.OutputTypingEvent if err := json.Unmarshal(msg.Value, &ote); err != nil { // Skip this msg but continue processing messages. - log.WithError(err).Errorf("typingserver output log: message parse failed") + log.WithError(err).Errorf("eduserver output log: message parse failed") return nil } diff --git a/syncapi/consumers/typingserver.go b/syncapi/consumers/typingserver.go index 369254411..150a26e51 100644 --- a/syncapi/consumers/typingserver.go +++ b/syncapi/consumers/typingserver.go @@ -22,7 +22,7 @@ import ( "github.com/matrix-org/dendrite/syncapi/storage" "github.com/matrix-org/dendrite/syncapi/sync" "github.com/matrix-org/dendrite/syncapi/types" - "github.com/matrix-org/dendrite/typingserver/api" + "github.com/matrix-org/dendrite/eduserver/api" log "github.com/sirupsen/logrus" sarama "gopkg.in/Shopify/sarama.v1" ) diff --git a/syncapi/storage/interface.go b/syncapi/storage/interface.go index b6dc19696..7d202f2b1 100644 --- a/syncapi/storage/interface.go +++ b/syncapi/storage/interface.go @@ -22,7 +22,7 @@ import ( "github.com/matrix-org/dendrite/common" "github.com/matrix-org/dendrite/roomserver/api" "github.com/matrix-org/dendrite/syncapi/types" - "github.com/matrix-org/dendrite/typingserver/cache" + "github.com/matrix-org/dendrite/eduserver/cache" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/syncapi/storage/postgres/syncserver.go b/syncapi/storage/postgres/syncserver.go index f3f1aabc7..bcc684790 100644 --- a/syncapi/storage/postgres/syncserver.go +++ b/syncapi/storage/postgres/syncserver.go @@ -31,7 +31,7 @@ import ( _ "github.com/lib/pq" "github.com/matrix-org/dendrite/common" "github.com/matrix-org/dendrite/syncapi/types" - "github.com/matrix-org/dendrite/typingserver/cache" + "github.com/matrix-org/dendrite/eduserver/cache" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/syncapi/storage/sqlite3/syncserver.go b/syncapi/storage/sqlite3/syncserver.go index 8ff189007..b245565d0 100644 --- a/syncapi/storage/sqlite3/syncserver.go +++ b/syncapi/storage/sqlite3/syncserver.go @@ -34,7 +34,7 @@ import ( "github.com/matrix-org/dendrite/common" "github.com/matrix-org/dendrite/syncapi/types" - "github.com/matrix-org/dendrite/typingserver/cache" + "github.com/matrix-org/dendrite/eduserver/cache" "github.com/matrix-org/gomatrixserverlib" )