- commit
- 03091f8
- parent
- d1ea229
- author
- Antonio Mika
- date
- 2024-10-02 21:44:04 +0000 UTC
Update go version and update pubsub features
10 files changed,
+13,
-11
+1,
-1
1@@ -24,7 +24,7 @@ jobs:
2 - name: Set up Go
3 uses: actions/setup-go@v3
4 with:
5- go-version: 1.22
6+ go-version: 1.23
7 - name: Checkout repo
8 uses: actions/checkout@v3
9 - name: Lint the codebase
+1,
-1
1@@ -13,7 +13,7 @@ jobs:
2 fetch-depth: 0
3 - uses: actions/setup-go@v4
4 with:
5- go-version: 1.22
6+ go-version: 1.23
7 - name: install pgit
8 run: |
9 go install github.com/picosh/pgit@v1
+1,
-1
1@@ -1,4 +1,4 @@
2-FROM --platform=$BUILDPLATFORM golang:1.22 AS builder-deps
3+FROM --platform=$BUILDPLATFORM golang:1.23 AS builder-deps
4 LABEL maintainer="Pico Maintainers <hello@pico.sh>"
5
6 WORKDIR /app
M
Makefile
+1,
-1
1@@ -86,7 +86,7 @@ pico-plus:
2
3 scripts:
4 # might need to set MINIO_URL
5- docker run --rm -it --env-file .env -v $(shell pwd):/app -w /app golang:1.22 /bin/bash
6+ docker run --rm -it --env-file .env -v $(shell pwd):/app -w /app golang:1.23 /bin/bash
7 .PHONY: scripts
8
9 fmt:
+1,
-1
1@@ -1,4 +1,4 @@
2-FROM golang:1.22-alpine AS builder
3+FROM golang:1.23-alpine AS builder
4
5 WORKDIR /app
6
M
dev.md
+1,
-1
1@@ -1,6 +1,6 @@
2 ## development
3
4-- `golang` >= 1.22.0
5+- `golang` >= 1.23.1
6 - `direnv` to load environment vars
7
8 ```bash
M
go.mod
+1,
-1
1@@ -37,7 +37,7 @@ require (
2 github.com/muesli/termenv v0.15.3-0.20240509142007-81b8f94111d5
3 github.com/neurosnap/go-exif-remove v0.0.0-20221010134343-50d1e3c35577
4 github.com/picosh/pobj v0.0.0-20240709135546-27097077b26a
5- github.com/picosh/pubsub v0.0.0-20241002203517-3ff0e5744b44
6+ github.com/picosh/pubsub v0.0.0-20241002213216-242caa6020e9
7 github.com/picosh/send v0.0.0-20240820031602-5d3b1a4494cc
8 github.com/picosh/tunkit v0.0.0-20240709033345-8315d4f3cd0e
9 github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
M
go.sum
+2,
-2
1@@ -223,8 +223,8 @@ github.com/picosh/go-rsync-receiver v0.0.0-20240709135253-1daf4b12a9fc h1:bvcsoO
2 github.com/picosh/go-rsync-receiver v0.0.0-20240709135253-1daf4b12a9fc/go.mod h1:i0iR3W4GSm1PuvVxB9OH32E5jP+CYkVb2NQSe0JCtlo=
3 github.com/picosh/pobj v0.0.0-20240709135546-27097077b26a h1:Cr1xODiyd/SjjBRtYA9VX6Do3D+w+DansQzkb4NGeyA=
4 github.com/picosh/pobj v0.0.0-20240709135546-27097077b26a/go.mod h1:VIkR1MZBvxSK2OO47jikxikAO/sKb/vTmXX5ZuYTIvo=
5-github.com/picosh/pubsub v0.0.0-20241002203517-3ff0e5744b44 h1:XNty1ovgt4r7WNydALjLIEKdlACit1X4qsYpktgzUlQ=
6-github.com/picosh/pubsub v0.0.0-20241002203517-3ff0e5744b44/go.mod h1:iuxAenTRpwThFkOJNw5Sumgv0FewjceHrl/4cHKkMe4=
7+github.com/picosh/pubsub v0.0.0-20241002213216-242caa6020e9 h1:rm5eAdIC4nY8u9B6/C+lB5PYqWpTK0xGjId8Fl9Cg30=
8+github.com/picosh/pubsub v0.0.0-20241002213216-242caa6020e9/go.mod h1:iuxAenTRpwThFkOJNw5Sumgv0FewjceHrl/4cHKkMe4=
9 github.com/picosh/send v0.0.0-20240820031602-5d3b1a4494cc h1:IIsJuAFG2ju3cygKVKTIsYYZf21q5S3Dr1H4fGbfgJg=
10 github.com/picosh/send v0.0.0-20240820031602-5d3b1a4494cc/go.mod h1:RAgLDK3LrDK6pNeXtU9tjo28obl5DxShcTUk2nm/KCM=
11 github.com/picosh/senpai v0.0.0-20240503200611-af89e73973b0 h1:pBRIbiCj7K6rGELijb//dYhyCo8A3fvxW5dijrJVtjs=
+1,
-1
1@@ -261,7 +261,7 @@ func WishMiddleware(handler *CliHandler) wish.Middleware {
2 } else if cmd == "sub" {
3 err = pubsub.PubSub.Sub(sesh.Context(), uuid.NewString(), sesh, []*psub.Channel{
4 psub.NewChannel(fmt.Sprintf("%s/%s", user.Name, repoName)),
5- })
6+ }, false)
7
8 if err != nil {
9 wish.Errorln(sesh, err)
+3,
-1
1@@ -190,7 +190,7 @@ func WishMiddleware(handler *CliHandler) wish.Middleware {
2 cmdArgs = args[2:]
3 }
4 logger.Info(
5- "imgs middleware detected command",
6+ "pubsub middleware detected command",
7 "args", args,
8 "cmd", cmd,
9 "channelName", channelName,
10@@ -307,6 +307,7 @@ func WishMiddleware(handler *CliHandler) wish.Middleware {
11 } else if cmd == "sub" {
12 pubCmd := flagSet("pub", sesh)
13 public := pubCmd.Bool("p", false, "Subscribe to a public channel")
14+ keepAlive := pubCmd.Bool("k", false, "Keep the sub alive even after the pub as died")
15 if !flagCheck(pubCmd, channelName, cmdArgs) {
16 return
17 }
18@@ -324,6 +325,7 @@ func WishMiddleware(handler *CliHandler) wish.Middleware {
19 []*psub.Channel{
20 psub.NewChannel(name),
21 },
22+ *keepAlive,
23 )
24
25 if err != nil {