Skip to content

Commit

Permalink
feat(deps): upgraded github.com/alexfalkowski/go-service to v1.201.0 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfalkowski committed May 22, 2024
1 parent 45a0e21 commit bd3c550
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 30 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.22.3

require (
github.com/alexfalkowski/go-health v1.17.0
github.com/alexfalkowski/go-service v1.200.1
github.com/alexfalkowski/go-service v1.201.0
github.com/golang-migrate/migrate/v4 v4.17.1
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0
go.opentelemetry.io/otel v1.27.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ github.com/aead/cmac v0.0.0-20160719120800-7af84192f0b1 h1:+JkXLHME8vLJafGhOH4ao
github.com/aead/cmac v0.0.0-20160719120800-7af84192f0b1/go.mod h1:nuudZmJhzWtx2212z+pkuy7B6nkBqa+xwNXZHL1j8cg=
github.com/alexfalkowski/go-health v1.17.0 h1:bGJPEsb05LhpetTepurzWba+sXuZ41utOrr4HvQKx4g=
github.com/alexfalkowski/go-health v1.17.0/go.mod h1:3Wp4CqKiDtVQUx9ss5Qs+PwAHkdI9d1xS8x56qYswqY=
github.com/alexfalkowski/go-service v1.200.1 h1:ZzDfWgwO8PUpwRVcz4M1rq4dVSS5gmpE8X6ZBcRJGuw=
github.com/alexfalkowski/go-service v1.200.1/go.mod h1:XFUNfqPoBsFQWCo/qIP9sfTgoCnYoT8DMwXYfpHFdJg=
github.com/alexfalkowski/go-service v1.201.0 h1:SZeF5xcq/ZDC8uJzWF8JjqqWTLGm7D7RhPYNiomrb5Q=
github.com/alexfalkowski/go-service v1.201.0/go.mod h1:XFUNfqPoBsFQWCo/qIP9sfTgoCnYoT8DMwXYfpHFdJg=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/arl/statsviz v0.6.0 h1:jbW1QJkEYQkufd//4NDYRSNBpwJNrdzPahF7ZmoGdyE=
github.com/arl/statsviz v0.6.0/go.mod h1:0toboo+YGSUXDaS4g1D5TVS4dXs7S7YYT5J/qnW2h8s=
Expand Down
9 changes: 5 additions & 4 deletions test/.config/invalid.client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ client:
v1:
host: localhost:2020
user_agent: "Migrieren-client/1.0 gRPC/1.0"
timeout: 1s
retry:
timeout: 2s
attempts: 3
migrate:
database: postgres
version: 1
retry:
attempts: 3
backoff: 100ms
timeout: 10s
timeout: 5s
telemetry:
logger:
level: info
Expand Down
9 changes: 5 additions & 4 deletions test/.config/misconfigured.client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ client:
v1:
host: localhost:12000
user_agent: "Migrieren-client/1.0 gRPC/1.0"
timeout: 1s
retry:
timeout: 2s
attempts: 3
migrate:
database: invalid_source
version: 1
retry:
attempts: 3
backoff: 100ms
timeout: 10s
timeout: 5s
telemetry:
logger:
level: info
Expand Down
9 changes: 5 additions & 4 deletions test/.config/missing.client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ client:
v1:
host: localhost:12000
user_agent: "Migrieren-client/1.0 gRPC/1.0"
timeout: 1s
retry:
timeout: 2s
attempts: 3
migrate:
database: missing
version: 1
retry:
attempts: 3
backoff: 100ms
timeout: 10s
timeout: 5s
telemetry:
logger:
level: info
Expand Down
13 changes: 9 additions & 4 deletions test/.config/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ client:
v1:
host: localhost:12000
user_agent: "Migrieren-client/1.0 gRPC/1.0"
timeout: 1s
retry:
timeout: 2s
attempts: 3
backoff: 100ms
timeout: 10s
timeout: 5s
health:
duration: 1s
timeout: 1s
Expand Down Expand Up @@ -42,11 +43,15 @@ transport:
port: 11000
user_agent: "Migrieren-server/1.0 HTTP/1.0"
retry:
timeout: 2s
attempts: 3
backoff: 100ms
timeout: 10s
timeout: 5s
grpc:
port: 12000
user_agent: "Migrieren-server/1.0 gRPC/1.0"
retry:
timeout: 2s
attempts: 3
backoff: 100ms
timeout: 10s
timeout: 5s
9 changes: 5 additions & 4 deletions test/.config/valid.client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ client:
v1:
host: localhost:12000
user_agent: "Migrieren-client/1.0 gRPC/1.0"
timeout: 1s
retry:
timeout: 2s
attempts: 3
migrate:
database: postgres
version: 1
retry:
attempts: 3
backoff: 100ms
timeout: 10s
timeout: 5s
telemetry:
logger:
level: info
Expand Down
6 changes: 3 additions & 3 deletions test/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ GEM
parser (3.3.1.0)
ast (~> 2.4.1)
racc
prism (0.27.0)
prism (0.29.0)
puma (6.4.2)
nio4r (~> 2.0)
racc (1.8.0)
Expand Down Expand Up @@ -133,9 +133,9 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
ruby-lsp (0.16.6)
ruby-lsp (0.16.7)
language_server-protocol (~> 3.17.0)
prism (>= 0.23.0, < 0.28)
prism (>= 0.29.0, < 0.30)
sorbet-runtime (>= 0.5.10782)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
Expand Down
10 changes: 6 additions & 4 deletions transport/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@ type ClientOpts struct {

// NewClient for gRPC.
func NewClient(options ClientOpts) (*g.ClientConn, error) {
sec, err := grpc.WithClientTLS(options.Client.TLS)
cfg := options.Client

sec, err := grpc.WithClientTLS(cfg.TLS)
if err != nil {
return nil, err
}

opts := []grpc.ClientOption{
grpc.WithClientLogger(options.Logger), grpc.WithClientTracer(options.Tracer),
grpc.WithClientMetrics(options.Meter), grpc.WithClientRetry(options.Client.Retry),
grpc.WithClientUserAgent(options.Client.UserAgent), grpc.WithClientTimeout(options.Client.Timeout), sec,
grpc.WithClientMetrics(options.Meter), grpc.WithClientRetry(cfg.Retry),
grpc.WithClientUserAgent(cfg.UserAgent), grpc.WithClientTimeout(cfg.Timeout), sec,
}

conn, err := grpc.NewClient(options.Client.Host, opts...)
conn, err := grpc.NewClient(cfg.Host, opts...)

options.Lifecycle.Append(fx.Hook{
OnStop: func(_ context.Context) error {
Expand Down

0 comments on commit bd3c550

Please sign in to comment.