deps: update via to v0.15.0, remove vianats dependency

NATS is now built into via.New() automatically. Stores use the new
v.PubSub() accessor instead of the removed vianats package.
This commit is contained in:
Ryan Hamamura
2026-02-12 15:10:18 -10:00
parent 3d019fd948
commit d2ed3cffd9
3 changed files with 6 additions and 13 deletions

13
main.go
View File

@@ -24,7 +24,6 @@ import (
"github.com/ryanhamamura/c4/ui"
"github.com/ryanhamamura/via"
"github.com/ryanhamamura/via/h"
"github.com/ryanhamamura/via/vianats"
)
var (
@@ -68,24 +67,18 @@ func main() {
log.Fatal(err)
}
ctx := context.Background()
ns, err := vianats.New(ctx, "./data/nats")
if err != nil {
log.Fatal(err)
}
store.SetPubSub(ns)
snakeStore.SetPubSub(ns)
v := via.New()
v.Config(via.Options{
LogLevel: via.LogLevelDebug,
DocumentTitle: "Game Lobby",
ServerAddress: ":" + port(),
SessionManager: sessionManager,
PubSub: ns,
Plugins: []via.Plugin{DaisyUIPlugin},
})
store.SetPubSub(v.PubSub())
snakeStore.SetPubSub(v.PubSub())
// Home page - tabbed lobby
v.Page("/", func(c *via.Context) {
userID := c.Session().GetString("user_id")