Skip to content

Commit

Permalink
Update pipe logger and other utils
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniomika committed Nov 16, 2024
1 parent 6ecebee commit adf572f
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 117 deletions.
5 changes: 4 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"mode": "auto",
"program": "${workspaceFolder}/cmd/${input:service}/${input:type}/main.go",
"envFile": "${workspaceFolder}/.env",
"cwd": "${workspaceFolder}"
"cwd": "${workspaceFolder}",
"buildFlags": [
"-race"
]
}
],
"inputs": [
Expand Down
4 changes: 2 additions & 2 deletions auth/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"github.com/picosh/pico/db"
"github.com/picosh/pico/db/postgres"
"github.com/picosh/pico/shared"
"github.com/picosh/pubsub"
"github.com/picosh/utils"
"github.com/picosh/utils/pipe"
)

type Client struct {
Expand Down Expand Up @@ -644,7 +644,7 @@ func handler(routes []shared.Route, client *Client) http.HandlerFunc {

func metricDrainSub(ctx context.Context, dbpool db.DB, logger *slog.Logger, secret string) {
conn := shared.NewPicoPipeClient()
stdoutPipe, err := pubsub.RemoteSub("sub metric-drain -k", ctx, conn)
stdoutPipe, err := pipe.Sub("sub metric-drain -k", ctx, conn)

if err != nil {
logger.Error("could not sub to metric-drain", "err", err)
Expand Down
70 changes: 36 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ go 1.23.1

// replace github.com/picosh/pubsub => ../pubsub

// replace github.com/picosh/utils => ../utils

replace git.sr.ht/~delthas/senpai => github.com/picosh/senpai v0.0.0-20240503200611-af89e73973b0

replace github.com/gdamore/tcell/v2 => github.com/delthas/tcell/v2 v2.4.1-0.20230710100648-1489e78d90fb
Expand All @@ -20,7 +22,7 @@ require (
github.com/antoniomika/syncmap v1.0.0
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
github.com/charmbracelet/bubbles v0.20.0
github.com/charmbracelet/bubbletea v1.1.2
github.com/charmbracelet/bubbletea v1.2.2
github.com/charmbracelet/glamour v0.8.0
github.com/charmbracelet/lipgloss v1.0.0
github.com/charmbracelet/promwish v0.7.0
Expand All @@ -36,10 +38,10 @@ require (
github.com/muesli/termenv v0.15.3-0.20240912151726-82936c5ea257
github.com/neurosnap/go-exif-remove v0.0.0-20221010134343-50d1e3c35577
github.com/picosh/pobj v0.0.0-20241016194248-c39198b2ff23
github.com/picosh/pubsub v0.0.0-20241114162342-5138571dceda
github.com/picosh/pubsub v0.0.0-20241114191831-ec8f16c0eb88
github.com/picosh/send v0.0.0-20241107150437-0febb0049b4f
github.com/picosh/tunkit v0.0.0-20240905223921-532404cef9d9
github.com/picosh/utils v0.0.0-20241018143404-b351d5d765f3
github.com/picosh/utils v0.0.0-20241116165501-b922efcc56f4
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
github.com/sendgrid/sendgrid-go v3.16.0+incompatible
github.com/simplesurance/go-ip-anonymizer v0.0.0-20200429124537-35a880f8e87d
Expand All @@ -50,7 +52,7 @@ require (
go.abhg.dev/goldmark/anchor v0.1.1
go.abhg.dev/goldmark/hashtag v0.3.1
go.abhg.dev/goldmark/toc v0.10.0
golang.org/x/crypto v0.28.0
golang.org/x/crypto v0.29.0
gopkg.in/yaml.v2 v2.4.0
)

Expand All @@ -61,36 +63,36 @@ require (
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aws/aws-sdk-go-v2 v1.32.3 // indirect
github.com/aws/aws-sdk-go-v2 v1.32.4 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 // indirect
github.com/aws/aws-sdk-go-v2/config v1.28.1 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.42 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.18 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.35 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.22 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.22 // indirect
github.com/aws/aws-sdk-go-v2/config v1.28.4 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.45 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.19 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.38 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.23 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.23 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.22 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.23 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.3 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.24.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.32.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.4 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.67.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.24.5 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.33.0 // indirect
github.com/aws/smithy-go v1.22.0 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/charmbracelet/keygen v0.5.1 // indirect
github.com/charmbracelet/log v0.4.0 // indirect
github.com/charmbracelet/x/ansi v0.4.2 // indirect
github.com/charmbracelet/x/ansi v0.4.5 // indirect
github.com/charmbracelet/x/conpty v0.1.0 // indirect
github.com/charmbracelet/x/errors v0.0.0-20241101155414-3df16cb7eefd // indirect
github.com/charmbracelet/x/errors v0.0.0-20241113152101-0af7d04e9f32 // indirect
github.com/charmbracelet/x/input v0.2.0 // indirect
github.com/charmbracelet/x/term v0.2.0 // indirect
github.com/charmbracelet/x/term v0.2.1 // indirect
github.com/charmbracelet/x/termios v0.1.0 // indirect
github.com/creack/pty v1.1.24 // indirect
github.com/delthas/go-libnp v0.0.0-20221222161248-0e45ece1f878 // indirect
Expand All @@ -115,22 +117,22 @@ require (
github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
github.com/golang/geo v0.0.0-20230421003525-6adc56603217 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/gorilla/css v1.0.1 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
github.com/kr/fs v0.1.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/minio/madmin-go/v3 v3.0.75 // indirect
github.com/minio/madmin-go/v3 v3.0.77 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/minio-go/v7 v7.0.80 // indirect
github.com/mmcdole/goxpp v1.1.1 // indirect
Expand All @@ -150,7 +152,7 @@ require (
github.com/prometheus/common v0.60.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prometheus/prom2json v1.4.1 // indirect
github.com/prometheus/prometheus v0.55.0 // indirect
github.com/prometheus/prometheus v0.300.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rs/xid v1.6.0 // indirect
Expand All @@ -165,13 +167,13 @@ require (
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/yuin/goldmark-emoji v1.0.4 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.7.0 // indirect
google.golang.org/protobuf v1.35.1 // indirect
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/term v0.26.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/time v0.8.0 // indirect
google.golang.org/protobuf v1.35.2 // indirect
mvdan.cc/xurls/v2 v2.5.0 // indirect
)
Loading

0 comments on commit adf572f

Please sign in to comment.