Skip to content

Commit

Permalink
Upgrade to AnyCable v1.5 and slog
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Jul 16, 2024
1 parent 0faa8f7 commit 3e9e1f7
Show file tree
Hide file tree
Showing 10 changed files with 168 additions and 473 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54.2
version: v1.59.1
args: --timeout 3m
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version-file: go.mod
- name: Run tests
run: |
make test
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test:

bin/golangci-lint:
@test -x $$(go env GOPATH)/bin/golangci-lint || \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.54.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.59.1

lint: bin/golangci-lint
$$(go env GOPATH)/bin/golangci-lint run
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# AnyCable Go scaffold

This is a template repository containing a scaffolding code to build real-time Go applications on top of [AnyCable-Go][anycable-go].
This is a template repository containing a scaffolding code to build real-time Go applications on top of [AnyCable][anycable-go].

Why building a WebSocket application with AnyCable-Go (and not other Go libraries)?
Why building a WebSocket application with AnyCable (and not other Go libraries)?

- Connect your application to Ruby/Rails apps with ease by using AnyCable RPC protocol.
- Connect your application to Ruby/Rails/JS/whatever apps with ease by using AnyCable RPC protocol.
- Many features out-of-the-box including different pub/sub adapters (including [embedded NATS][enats]), built-in instrumentation.
- Bulletproof code, which has been used production for years.

Read more about [AnyCable-Go][anycable-docs].
Read more about [AnyCable][anycable-docs].

## Examples

Expand All @@ -28,7 +28,7 @@ Make sure everything is ready by running `make lint` and `make test`.

## Development

**NOTE:** Make sure Go 1.20+ installed.
**NOTE:** Make sure Go 1.21+ installed.

The following commands are available:

Expand Down
6 changes: 2 additions & 4 deletions cmd/mycable/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"github.com/anycable/mycable/pkg/config"
"github.com/anycable/mycable/pkg/version"

"github.com/apex/log"

_ "github.com/anycable/anycable-go/diagnostics"
)

Expand All @@ -20,13 +18,13 @@ func main() {
anyconf, err, ok := acli.NewConfigFromCLI(
os.Args,
acli.WithCLIName("mycable"),
acli.WithCLIUsageHeader("MyCable, the custom AnyCable-Go build"),
acli.WithCLIUsageHeader("MyCable, a custom AnyCable build"),
acli.WithCLIVersion(version.Version()),
acli.WithCLICustomOptions(cli.CustomOptions(conf)),
)

if err != nil {
log.Fatalf("%v", err)
panic(err)
}

if ok {
Expand Down
72 changes: 36 additions & 36 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
module github.com/anycable/mycable

go 1.20
go 1.21

require (
github.com/anycable/anycable-go v1.4.5
github.com/apex/log v1.9.0
github.com/gorilla/websocket v1.5.0
github.com/urfave/cli/v2 v2.24.1
github.com/anycable/anycable-go v1.5.2
github.com/gorilla/websocket v1.5.1
github.com/urfave/cli/v2 v2.27.1
)

require (
github.com/FZambia/sentinel v1.1.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/fullstorydev/grpchan v1.0.2-0.20210924023933-8d2633e44524 // indirect
github.com/go-chi/chi/v5 v5.0.8 // indirect
github.com/FZambia/sentinel v1.1.1 // indirect
github.com/bufbuild/protocompile v0.7.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/fullstorydev/grpchan v1.1.1 // indirect
github.com/go-chi/chi/v5 v5.0.11 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/gomodule/redigo v1.8.8 // indirect
github.com/google/gops v0.3.27 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/gomodule/redigo v1.8.9 // indirect
github.com/google/gops v0.3.28 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/hofstadter-io/cinful v1.0.0 // indirect
github.com/jhump/protoreflect v1.5.0 // indirect
github.com/joomcode/errorx v1.1.0 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/jhump/protoreflect v1.15.4 // indirect
github.com/joomcode/errorx v1.1.1 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/lmittmann/tint v1.0.4 // indirect
github.com/matoous/go-nanoid v1.5.0 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/mitchellh/go-mruby v0.0.0-20200315023956-207cedc21542 // indirect
github.com/nats-io/jwt/v2 v2.3.0 // indirect
github.com/nats-io/nats-server/v2 v2.9.14 // indirect
github.com/nats-io/nats.go v1.24.0 // indirect
github.com/nats-io/nkeys v0.3.0 // indirect
github.com/nats-io/jwt/v2 v2.5.3 // indirect
github.com/nats-io/nats-server/v2 v2.10.7 // indirect
github.com/nats-io/nats.go v1.31.0 // indirect
github.com/nats-io/nkeys v0.4.7 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/posthog/posthog-go v0.0.0-20221221115252-24dfed35d71a // indirect
github.com/redis/rueidis v1.0.17 // indirect
github.com/posthog/posthog-go v0.0.0-20240110105835-f2ee529330e9 // indirect
github.com/redis/rueidis v1.0.26 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/smira/go-statsd v1.3.2 // indirect
github.com/smira/go-statsd v1.3.3 // indirect
github.com/sony/gobreaker v0.5.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect
go.uber.org/automaxprocs v1.5.1 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44 // indirect
google.golang.org/grpc v1.53.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e // indirect
go.uber.org/automaxprocs v1.5.3 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/exp v0.0.0-20240110193028-0dcbfd608b1e // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect
google.golang.org/grpc v1.60.1 // indirect
google.golang.org/protobuf v1.32.0 // indirect
)
Loading

0 comments on commit 3e9e1f7

Please sign in to comment.