From df574e484699ffe523fe6ff4bb799ef3797854f4 Mon Sep 17 00:00:00 2001 From: Mitch Roote Date: Tue, 26 Jan 2021 21:33:50 -0500 Subject: [PATCH 1/3] Update imports to point to new organization --- src/api/auth.go | 7 ++++--- src/api/handlers.go | 7 ++++--- src/api/mod_modpack_handler.go | 7 ++++--- src/api/mod_modpack_handler_test.go | 10 ++++++---- src/api/mod_portal_handler.go | 5 +++-- src/api/mods_handler.go | 7 ++++--- src/api/mods_handler_test.go | 13 +++++++------ src/api/routes.go | 3 ++- src/api/websocket/wshub.go | 3 ++- src/factorio/credentials.go | 3 ++- src/factorio/gamelog.go | 5 +++-- src/factorio/mod_Mods.go | 3 ++- src/factorio/mod_modInfo.go | 3 ++- src/factorio/mod_modpack.go | 3 ++- src/factorio/mods.go | 3 ++- src/factorio/rcon.go | 3 ++- src/factorio/saves.go | 3 ++- src/factorio/server.go | 4 ++-- src/go.mod | 2 +- src/main.go | 6 +++--- 20 files changed, 59 insertions(+), 41 deletions(-) diff --git a/src/api/auth.go b/src/api/auth.go index 5e17744..f3836a3 100644 --- a/src/api/auth.go +++ b/src/api/auth.go @@ -2,13 +2,14 @@ package api import ( "encoding/base64" + "log" + "net/http" + + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" "github.com/gorilla/sessions" - "github.com/mroote/factorio-server-manager/bootstrap" "golang.org/x/crypto/bcrypt" "gorm.io/driver/sqlite" "gorm.io/gorm" - "log" - "net/http" ) type User bootstrap.User diff --git a/src/api/handlers.go b/src/api/handlers.go index c2ac75a..afc0214 100644 --- a/src/api/handlers.go +++ b/src/api/handlers.go @@ -4,9 +4,6 @@ import ( "encoding/json" "errors" "fmt" - "github.com/gorilla/sessions" - "github.com/mroote/factorio-server-manager/bootstrap" - "github.com/mroote/factorio-server-manager/factorio" "io" "io/ioutil" "log" @@ -17,6 +14,10 @@ import ( "sync" "time" + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" + "github.com/OpenFactorioServerManager/factorio-server-manager/factorio" + "github.com/gorilla/sessions" + "github.com/gorilla/mux" ) diff --git a/src/api/mod_modpack_handler.go b/src/api/mod_modpack_handler.go index f30090a..e1d9f29 100644 --- a/src/api/mod_modpack_handler.go +++ b/src/api/mod_modpack_handler.go @@ -4,14 +4,15 @@ import ( "archive/zip" "errors" "fmt" - "github.com/gorilla/mux" - "github.com/mroote/factorio-server-manager/bootstrap" - "github.com/mroote/factorio-server-manager/factorio" "io" "log" "net/http" "os" "path/filepath" + + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" + "github.com/OpenFactorioServerManager/factorio-server-manager/factorio" + "github.com/gorilla/mux" ) func CheckModPackExists(modPackMap factorio.ModPackMap, modPackName string, w http.ResponseWriter) (resp interface{}, err error) { diff --git a/src/api/mod_modpack_handler_test.go b/src/api/mod_modpack_handler_test.go index 82bff5a..0c93861 100644 --- a/src/api/mod_modpack_handler_test.go +++ b/src/api/mod_modpack_handler_test.go @@ -3,10 +3,6 @@ package api import ( "bytes" "encoding/json" - "github.com/gorilla/mux" - "github.com/mroote/factorio-server-manager/bootstrap" - "github.com/mroote/factorio-server-manager/factorio" - "github.com/stretchr/testify/assert" "io" "mime/multipart" "net/http" @@ -15,6 +11,12 @@ import ( "path/filepath" "strings" "testing" + + "github.com/OpenFactorioServerManager/factorio-server-manager" + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" + "github.com/OpenFactorioServerManager/factorio-server-manager/factorio" + "github.com/gorilla/mux" + "github.com/stretchr/testify/assert" ) func SetupModPacks(t *testing.T, empty bool, emptyMods bool) { diff --git a/src/api/mod_portal_handler.go b/src/api/mod_portal_handler.go index 3e9d3af..076db45 100644 --- a/src/api/mod_portal_handler.go +++ b/src/api/mod_portal_handler.go @@ -2,10 +2,11 @@ package api import ( "fmt" - "github.com/gorilla/mux" - "github.com/mroote/factorio-server-manager/factorio" "log" "net/http" + + "github.com/OpenFactorioServerManager/factorio-server-manager/factorio" + "github.com/gorilla/mux" ) func ModPortalListModsHandler(w http.ResponseWriter, r *http.Request) { diff --git a/src/api/mods_handler.go b/src/api/mods_handler.go index 86b9d4a..ab6db3d 100644 --- a/src/api/mods_handler.go +++ b/src/api/mods_handler.go @@ -4,14 +4,15 @@ import ( "archive/zip" "encoding/json" "fmt" - "github.com/mroote/factorio-server-manager/bootstrap" - "github.com/mroote/factorio-server-manager/factorio" - "github.com/mroote/factorio-server-manager/lockfile" "io" "log" "net/http" "os" "path/filepath" + + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" + "github.com/OpenFactorioServerManager/factorio-server-manager/factorio" + "github.com/OpenFactorioServerManager/factorio-server-manager/lockfile" ) func CreateNewMods(w http.ResponseWriter) (modList factorio.Mods, resp interface{}, err error) { diff --git a/src/api/mods_handler_test.go b/src/api/mods_handler_test.go index c28cfb1..51600b2 100644 --- a/src/api/mods_handler_test.go +++ b/src/api/mods_handler_test.go @@ -2,12 +2,6 @@ package api import ( "bytes" - "github.com/gorilla/mux" - "github.com/joho/godotenv" - "github.com/mroote/factorio-server-manager/bootstrap" - "github.com/mroote/factorio-server-manager/factorio" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "io" "log" "mime/multipart" @@ -17,6 +11,13 @@ import ( "path/filepath" "strings" "testing" + + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" + "github.com/OpenFactorioServerManager/factorio-server-manager/factorio" + "github.com/gorilla/mux" + "github.com/joho/godotenv" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestMain(m *testing.M) { diff --git a/src/api/routes.go b/src/api/routes.go index 0c8908a..5349a9f 100644 --- a/src/api/routes.go +++ b/src/api/routes.go @@ -1,9 +1,10 @@ package api import ( - "github.com/mroote/factorio-server-manager/api/websocket" "net/http" + "github.com/OpenFactorioServerManager/factorio-server-manager/api/websocket" + "github.com/gorilla/mux" ) diff --git a/src/api/websocket/wshub.go b/src/api/websocket/wshub.go index f882eb6..32a9b2f 100644 --- a/src/api/websocket/wshub.go +++ b/src/api/websocket/wshub.go @@ -1,8 +1,9 @@ package websocket import ( - "github.com/mroote/factorio-server-manager/bootstrap" "reflect" + + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" ) // the hub, that is exported and can be used anywhere to work with the websocket diff --git a/src/factorio/credentials.go b/src/factorio/credentials.go index ede9ad3..8005590 100644 --- a/src/factorio/credentials.go +++ b/src/factorio/credentials.go @@ -3,10 +3,11 @@ package factorio import ( "encoding/json" "errors" - "github.com/mroote/factorio-server-manager/bootstrap" "io/ioutil" "log" "os" + + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" ) type Credentials struct { diff --git a/src/factorio/gamelog.go b/src/factorio/gamelog.go index f30d6ef..e920301 100644 --- a/src/factorio/gamelog.go +++ b/src/factorio/gamelog.go @@ -1,9 +1,10 @@ package factorio import ( - "github.com/hpcloud/tail" - "github.com/mroote/factorio-server-manager/bootstrap" "log" + + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" + "github.com/hpcloud/tail" ) func TailLog() ([]string, error) { diff --git a/src/factorio/mod_Mods.go b/src/factorio/mod_Mods.go index e7191ef..c9f3298 100644 --- a/src/factorio/mod_Mods.go +++ b/src/factorio/mod_Mods.go @@ -5,13 +5,14 @@ import ( "bytes" "errors" "fmt" - "github.com/mroote/factorio-server-manager/lockfile" "io" "io/ioutil" "log" "mime/multipart" "net/http" "path/filepath" + + "github.com/OpenFactorioServerManager/factorio-server-manager/lockfile" ) type Mods struct { diff --git a/src/factorio/mod_modInfo.go b/src/factorio/mod_modInfo.go index 2de35aa..b948277 100644 --- a/src/factorio/mod_modInfo.go +++ b/src/factorio/mod_modInfo.go @@ -4,13 +4,14 @@ import ( "archive/zip" "encoding/json" "errors" - "github.com/mroote/factorio-server-manager/lockfile" "io" "io/ioutil" "log" "os" "path/filepath" "strings" + + "github.com/OpenFactorioServerManager/factorio-server-manager/lockfile" ) type ModInfoList struct { diff --git a/src/factorio/mod_modpack.go b/src/factorio/mod_modpack.go index d387eba..2b10f5e 100644 --- a/src/factorio/mod_modpack.go +++ b/src/factorio/mod_modpack.go @@ -2,12 +2,13 @@ package factorio import ( "errors" - "github.com/mroote/factorio-server-manager/bootstrap" "io" "io/ioutil" "log" "os" "path/filepath" + + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" ) type ModPackMap map[string]*ModPack diff --git a/src/factorio/mods.go b/src/factorio/mods.go index ebde758..9fc4083 100644 --- a/src/factorio/mods.go +++ b/src/factorio/mods.go @@ -5,12 +5,13 @@ import ( "bytes" "encoding/json" "errors" - "github.com/mroote/factorio-server-manager/bootstrap" "io/ioutil" "log" "os" "path/filepath" "strings" + + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" ) type LoginErrorResponse struct { diff --git a/src/factorio/rcon.go b/src/factorio/rcon.go index ba8f8f7..cc5fc9d 100644 --- a/src/factorio/rcon.go +++ b/src/factorio/rcon.go @@ -1,10 +1,11 @@ package factorio import ( - "github.com/mroote/factorio-server-manager/bootstrap" "log" "strconv" + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" + "github.com/majormjr/rcon" ) diff --git a/src/factorio/saves.go b/src/factorio/saves.go index 8bbf92b..01051b8 100644 --- a/src/factorio/saves.go +++ b/src/factorio/saves.go @@ -3,12 +3,13 @@ package factorio import ( "errors" "fmt" - "github.com/mroote/factorio-server-manager/bootstrap" "log" "os" "os/exec" "path/filepath" "time" + + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" ) type Save struct { diff --git a/src/factorio/server.go b/src/factorio/server.go index 55d5234..b43dfbd 100644 --- a/src/factorio/server.go +++ b/src/factorio/server.go @@ -14,8 +14,8 @@ import ( "strings" "sync" - "github.com/mroote/factorio-server-manager/api/websocket" - "github.com/mroote/factorio-server-manager/bootstrap" + "github.com/OpenFactorioServerManager/factorio-server-manager/api/websocket" + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" "github.com/majormjr/rcon" ) diff --git a/src/go.mod b/src/go.mod index 13d2c0c..ca3aa3e 100644 --- a/src/go.mod +++ b/src/go.mod @@ -1,4 +1,4 @@ -module github.com/mroote/factorio-server-manager +module github.com/OpenFactorioServerManager/factorio-server-manager go 1.13 diff --git a/src/main.go b/src/main.go index 6ff9277..40c6143 100644 --- a/src/main.go +++ b/src/main.go @@ -5,9 +5,9 @@ import ( "net/http" "os" - "github.com/mroote/factorio-server-manager/api" - "github.com/mroote/factorio-server-manager/bootstrap" - "github.com/mroote/factorio-server-manager/factorio" + "github.com/OpenFactorioServerManager/factorio-server-manager/api" + "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" + "github.com/OpenFactorioServerManager/factorio-server-manager/factorio" ) func main() { From 8c7ba404e547b5c68532ffc56ddc4393497fc6d5 Mon Sep 17 00:00:00 2001 From: Mitch Roote Date: Tue, 26 Jan 2021 21:38:50 -0500 Subject: [PATCH 2/3] update rcon import --- src/factorio/rcon.go | 2 +- src/factorio/server.go | 3 +-- src/go.mod | 1 + src/go.sum | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/factorio/rcon.go b/src/factorio/rcon.go index cc5fc9d..11d8edc 100644 --- a/src/factorio/rcon.go +++ b/src/factorio/rcon.go @@ -6,7 +6,7 @@ import ( "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" - "github.com/majormjr/rcon" + "github.com/OpenFactorioServerManager/rcon" ) func connectRC() error { diff --git a/src/factorio/server.go b/src/factorio/server.go index b43dfbd..6345389 100644 --- a/src/factorio/server.go +++ b/src/factorio/server.go @@ -16,8 +16,7 @@ import ( "github.com/OpenFactorioServerManager/factorio-server-manager/api/websocket" "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" - - "github.com/majormjr/rcon" + "github.com/OpenFactorioServerManager/rcon" ) type Server struct { diff --git a/src/go.mod b/src/go.mod index ca3aa3e..248da75 100644 --- a/src/go.mod +++ b/src/go.mod @@ -3,6 +3,7 @@ module github.com/OpenFactorioServerManager/factorio-server-manager go 1.13 require ( + github.com/OpenFactorioServerManager/rcon v0.0.0-20120923215419-8fbb8268b60a github.com/go-ini/ini v1.49.0 github.com/golang/protobuf v1.3.1 // indirect github.com/gorilla/mux v1.7.3 diff --git a/src/go.sum b/src/go.sum index 77eac32..34a8b41 100644 --- a/src/go.sum +++ b/src/go.sum @@ -1,3 +1,5 @@ +github.com/OpenFactorioServerManager/rcon v0.0.0-20120923215419-8fbb8268b60a h1:BExxUM1IlQh7ba2D7ZTQ/aHe65YLI0GHgoPe1c3IIdA= +github.com/OpenFactorioServerManager/rcon v0.0.0-20120923215419-8fbb8268b60a/go.mod h1:ttMDbVLzmIWHIVGL6Wa+QG+hCzURs5gZDT12l5spIlg= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= From 0501ab4a3cd0640f6cf3e82bf91bf3d470ea25e4 Mon Sep 17 00:00:00 2001 From: Mitch Roote Date: Tue, 26 Jan 2021 21:45:41 -0500 Subject: [PATCH 3/3] fix test cyclic import, tidy mod.go --- src/api/mod_modpack_handler_test.go | 1 - src/go.mod | 1 - src/go.sum | 2 -- 3 files changed, 4 deletions(-) diff --git a/src/api/mod_modpack_handler_test.go b/src/api/mod_modpack_handler_test.go index 0c93861..4169546 100644 --- a/src/api/mod_modpack_handler_test.go +++ b/src/api/mod_modpack_handler_test.go @@ -12,7 +12,6 @@ import ( "strings" "testing" - "github.com/OpenFactorioServerManager/factorio-server-manager" "github.com/OpenFactorioServerManager/factorio-server-manager/bootstrap" "github.com/OpenFactorioServerManager/factorio-server-manager/factorio" "github.com/gorilla/mux" diff --git a/src/go.mod b/src/go.mod index 248da75..cfdd4d7 100644 --- a/src/go.mod +++ b/src/go.mod @@ -13,7 +13,6 @@ require ( github.com/hpcloud/tail v1.0.0 github.com/jessevdk/go-flags v1.4.0 github.com/joho/godotenv v1.3.0 - github.com/majormjr/rcon v0.0.0-20120923215419-8fbb8268b60a github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect github.com/stretchr/testify v1.6.1 github.com/syndtr/goleveldb v1.0.0 diff --git a/src/go.sum b/src/go.sum index 34a8b41..53c619c 100644 --- a/src/go.sum +++ b/src/go.sum @@ -34,8 +34,6 @@ github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/majormjr/rcon v0.0.0-20120923215419-8fbb8268b60a h1:rXEd7/SA5sJvgl2zxM/nNblGa9kkpnx2phQATclw9Xk= -github.com/majormjr/rcon v0.0.0-20120923215419-8fbb8268b60a/go.mod h1:RNVV4T548mxgb643odZHF+pWh/YmGLxiKvtkbI1vRYE= github.com/mattn/go-sqlite3 v1.14.5 h1:1IdxlwTNazvbKJQSxoJ5/9ECbEeaTTyeU7sEAZ5KKTQ= github.com/mattn/go-sqlite3 v1.14.5/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=