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

2
go.mod
View File

@@ -6,7 +6,7 @@ require (
github.com/google/uuid v1.6.0
github.com/joho/godotenv v1.5.1
github.com/pressly/goose/v3 v3.26.0
github.com/ryanhamamura/via v0.4.0
github.com/ryanhamamura/via v0.15.0
golang.org/x/crypto v0.47.0
modernc.org/sqlite v1.44.0
)

4
go.sum
View File

@@ -78,8 +78,8 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qq
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
github.com/ryanhamamura/via v0.4.0 h1:/8gfjcPhTl+SEYTPF+Guc6qB2vuW+FtNRQv+HpkV2k8=
github.com/ryanhamamura/via v0.4.0/go.mod h1:w6dKEB+TYAyg2VTGh01doTjYP3xjDX7UO5Bis8nFt1A=
github.com/ryanhamamura/via v0.15.0 h1:f9ZMzWZQamu8MgdKiPPX6U8rIGfI3P3zVlmd/DTUUQ0=
github.com/ryanhamamura/via v0.15.0/go.mod h1:rpJewNVG6tgginZN7Be3qqRuol70+v1sFCKD4UjHsQo=
github.com/sethvargo/go-retry v0.3.0 h1:EEt31A35QhrcRZtrYFDTBg91cqZVnFL2navjDrah2SE=
github.com/sethvargo/go-retry v0.3.0/go.mod h1:mNX17F0C/HguQMyMyJxcnU471gOZGxCLyYaFyAZraas=
github.com/starfederation/datastar-go v1.0.3 h1:DnzgsJ6tDHDM6y5Nxsk0AGW/m8SyKch2vQg3P1xGTcU=

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")