diff --git a/README.md b/README.md index e6de563..1d85e85 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Match patterns and solve anagrams - handy for crossword fanatics. ## Standalone Server ```bash +cd standalone go run main.go ``` @@ -14,7 +15,7 @@ To test using the Cloud Functions Framework: ```bash env FUNCTION_TARGET=WordSearch WORDLIST_BUCKET=word-search-1729-assets \ - WORDLIST_PATH=data/wordlist.txt LOCAL_ONLY=true go run cmd/main.go + WORDLIST_PATH=data/wordlist.txt LOCAL_ONLY=true go run ./cmd/fn-framework-test/main.go curl 'http://localhost:8080?mode=anagrams&pattern=idea' ``` diff --git a/anagram/anagram.go b/anagram/anagram.go index 7c29e76..227165f 100644 --- a/anagram/anagram.go +++ b/anagram/anagram.go @@ -5,7 +5,7 @@ import ( "io" "sort" - "github.com/ray1729/puzzle-solver/util" + "github.com/ray1729/wordsearch/util" ) type DB interface { diff --git a/cloudfn/cloudfn.go b/cloudfn.go similarity index 97% rename from cloudfn/cloudfn.go rename to cloudfn.go index 6b1419d..75534f1 100644 --- a/cloudfn/cloudfn.go +++ b/cloudfn.go @@ -1,4 +1,4 @@ -package cloudfn +package wordsearch import ( "bufio" @@ -12,8 +12,8 @@ import ( "cloud.google.com/go/storage" "github.com/GoogleCloudPlatform/functions-framework-go/functions" - "github.com/ray1729/puzzle-solver/anagram" - "github.com/ray1729/puzzle-solver/match" + "github.com/ray1729/wordsearch/anagram" + "github.com/ray1729/wordsearch/match" "github.com/rs/cors" ) diff --git a/fix-wordlist/main.go b/cmd/fix-wordlist/main.go similarity index 100% rename from fix-wordlist/main.go rename to cmd/fix-wordlist/main.go diff --git a/cmd/main.go b/cmd/fn-framework-test/main.go similarity index 94% rename from cmd/main.go rename to cmd/fn-framework-test/main.go index d47df5b..e02e774 100644 --- a/cmd/main.go +++ b/cmd/fn-framework-test/main.go @@ -6,7 +6,7 @@ import ( // Blank-import the function package so the init() runs "github.com/GoogleCloudPlatform/functions-framework-go/funcframework" - _ "github.com/ray1729/puzzle-solver/cloudfn" + _ "github.com/ray1729/wordsearch" ) func main() { diff --git a/go.mod b/go.mod index 8303040..7b8b9f4 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/ray1729/puzzle-solver +module github.com/ray1729/wordsearch go 1.21.1 diff --git a/match/match.go b/match/match.go index 3081b86..7179e17 100644 --- a/match/match.go +++ b/match/match.go @@ -4,7 +4,7 @@ import ( "bufio" "io" - "github.com/ray1729/puzzle-solver/util" + "github.com/ray1729/wordsearch/util" ) type DB interface { diff --git a/assets/custom.css b/standalone/assets/custom.css similarity index 100% rename from assets/custom.css rename to standalone/assets/custom.css diff --git a/assets/htmx.min.js b/standalone/assets/htmx.min.js similarity index 100% rename from assets/htmx.min.js rename to standalone/assets/htmx.min.js diff --git a/assets/simple.css b/standalone/assets/simple.css similarity index 100% rename from assets/simple.css rename to standalone/assets/simple.css diff --git a/main.go b/standalone/main.go similarity index 83% rename from main.go rename to standalone/main.go index b36db24..3d4e031 100644 --- a/main.go +++ b/standalone/main.go @@ -6,9 +6,9 @@ import ( "net/http" "os" - "github.com/ray1729/puzzle-solver/anagram" - "github.com/ray1729/puzzle-solver/match" - "github.com/ray1729/puzzle-solver/server" + "github.com/ray1729/wordsearch/anagram" + "github.com/ray1729/wordsearch/match" + "github.com/ray1729/wordsearch/standalone/server" ) var matchDB match.DB diff --git a/server/server.go b/standalone/server/server.go similarity index 96% rename from server/server.go rename to standalone/server/server.go index e937595..7752f6d 100644 --- a/server/server.go +++ b/standalone/server/server.go @@ -7,8 +7,8 @@ import ( "net/http" "sort" - "github.com/ray1729/puzzle-solver/anagram" - "github.com/ray1729/puzzle-solver/match" + "github.com/ray1729/wordsearch/anagram" + "github.com/ray1729/wordsearch/match" ) func New(assetsPath string, matchDB match.DB, anagramDB anagram.DB) http.Handler { diff --git a/server/templates.go b/standalone/server/templates.go similarity index 100% rename from server/templates.go rename to standalone/server/templates.go diff --git a/wordlist.txt b/standalone/wordlist.txt similarity index 100% rename from wordlist.txt rename to standalone/wordlist.txt