refactor: rename game package to connect4, drop Game prefix from types
Rename game/ -> connect4/ to avoid c4/game stutter. Drop redundant
Game prefix from exported types (GameStore -> Store, GameInstance ->
Instance, GameStatus -> Status). Rename NATS subjects from game.{id}
to connect4.{id}. URL routes unchanged.
This commit is contained in:
6
main.go
6
main.go
@@ -12,9 +12,9 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/ryanhamamura/c4/config"
|
||||
"github.com/ryanhamamura/c4/connect4"
|
||||
"github.com/ryanhamamura/c4/db"
|
||||
"github.com/ryanhamamura/c4/db/repository"
|
||||
"github.com/ryanhamamura/c4/game"
|
||||
"github.com/ryanhamamura/c4/logging"
|
||||
appnats "github.com/ryanhamamura/c4/nats"
|
||||
"github.com/ryanhamamura/c4/router"
|
||||
@@ -71,9 +71,9 @@ func run(ctx context.Context) error {
|
||||
defer cleanupNATS()
|
||||
|
||||
// Game stores
|
||||
store := game.NewGameStore(queries)
|
||||
store := connect4.NewStore(queries)
|
||||
store.SetNotifyFunc(func(gameID string) {
|
||||
nc.Publish("game."+gameID, nil) //nolint:errcheck // best-effort notification
|
||||
nc.Publish("connect4."+gameID, nil) //nolint:errcheck // best-effort notification
|
||||
})
|
||||
|
||||
snakeStore := snake.NewSnakeStore(queries)
|
||||
|
||||
Reference in New Issue
Block a user