Skip to content

Commit

Permalink
gRPC connection pooling grpcconn (#178)
Browse files Browse the repository at this point in the history
* gRPC connection pooling `grpcconn`
  • Loading branch information
Baliedge authored Sep 25, 2023
1 parent 9c081b6 commit d52ca92
Show file tree
Hide file tree
Showing 13 changed files with 675 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
version: v1.54.2
skip-cache: true # cache/restore is done by actions/setup-go@v3 step
args: -v
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
go-version:
- 1.19.x
- 1.20.x
- 1.21.x
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
Expand Down
33 changes: 15 additions & 18 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ linters:
disable-all: true
enable:
- bodyclose # https://github.com/timakin/bodyclose
- depguard
- gomodguard
- errcheck # Mandatory. Do not disable.
- gocritic
- goimports
Expand Down Expand Up @@ -74,23 +74,20 @@ linters-settings:
- shadow
- fieldalignment

depguard:
# Kind of list is passed in.
# Allowed values: allowlist|denylist
# Default: denylist
list-type: denylist
# Check the list against standard lib.
# Default: false
include-go-root: true
# A list of packages for the list type specified.
# Default: []
packages:
- github.com/pkg/errors
# A list of packages for the list type specified.
# Specify an error message to output when a denied package is used.
# Default: []
packages-with-error-message:
- github.com/pkg/errors: 'Deprecated: use standard "errors" or "github.com/mailgun/holster/v4/errors" instead.'
gomodguard:
blocked:
# List of blocked modules.
# Default: []
modules:
- github.com/golang/protobuf:
recommendations:
- google.golang.org/protobuf
reason: "see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules"
- github.com/pkg/errors:
recommendations:
- errors
- github.com/mailgun/errors
reason: "Deprecated"

stylecheck:
# Select the Go version to target.
Expand Down
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
GOLINT = $(GOPATH)/bin/golangci-lint
GOLANGCI_LINT = $(GOPATH)/bin/golangci-lint
GOLANGCI_LINT_VERSION = v1.54.1

.PHONY: lint
lint: $(GOLINT)
$(GOLINT) run
lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run

$(GOLINT):
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.52.2
$(GOLANGCI_LINT):
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin $(GOLANGCI_LINT_VERSION)

.PHONY: test
test:
Expand Down
2 changes: 1 addition & 1 deletion callstack/callstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"strings"

pkgerrors "github.com/pkg/errors" //nolint:depguard // Legacy code requires deprecated package.
pkgerrors "github.com/pkg/errors" //nolint:gomodguard // Legacy code requires deprecated package.
)

type FrameInfo struct {
Expand Down
2 changes: 1 addition & 1 deletion errors/context_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"

"github.com/mailgun/holster/v4/callstack"
pkgerrors "github.com/pkg/errors" //nolint:depguard // Legacy code requires deprecated package.
pkgerrors "github.com/pkg/errors" //nolint:gomodguard // Legacy code requires deprecated package.
)

// Implements the `error` `causer` and `Contexter` interfaces
Expand Down
2 changes: 1 addition & 1 deletion errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ import (
"io"

stack "github.com/mailgun/holster/v4/callstack"
pkgerrors "github.com/pkg/errors" //nolint:depguard // Legacy code requires deprecated package.
pkgerrors "github.com/pkg/errors" //nolint:gomodguard // Legacy code requires deprecated package.
"github.com/sirupsen/logrus"
)

Expand Down
2 changes: 1 addition & 1 deletion errors/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/mailgun/holster/v4/errors"
pkgerrors "github.com/pkg/errors" //nolint:depguard // Legacy code requires deprecated package.
pkgerrors "github.com/pkg/errors" //nolint:gomodguard // Legacy code requires deprecated package.
)

func ExampleNew() {
Expand Down
24 changes: 14 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,26 @@ require (
github.com/hashicorp/consul/api v1.15.2
github.com/hashicorp/go-hclog v1.3.1
github.com/hashicorp/memberlist v0.5.0
github.com/mailgun/errors v0.1.5
github.com/miekg/dns v1.1.50
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.13.0
github.com/sirupsen/logrus v1.9.2
github.com/stretchr/testify v1.8.3
github.com/stretchr/testify v1.8.4
github.com/uptrace/opentelemetry-go-extra/otellogrus v0.2.1
go.etcd.io/etcd/api/v3 v3.5.5
go.etcd.io/etcd/client/v3 v3.5.5
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.43.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0
go.opentelemetry.io/otel v1.16.0
go.opentelemetry.io/otel v1.17.0
go.opentelemetry.io/otel/exporters/jaeger v1.16.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.16.0
go.opentelemetry.io/otel/sdk v1.16.0
go.opentelemetry.io/otel/trace v1.16.0
golang.org/x/net v0.8.0
google.golang.org/grpc v1.55.0
go.opentelemetry.io/otel/trace v1.17.0
golang.org/x/net v0.14.0
google.golang.org/grpc v1.57.0
gopkg.in/yaml.v3 v3.0.1
)

Expand Down Expand Up @@ -71,16 +73,18 @@ require (
github.com/uptrace/opentelemetry-go-extra/otelutil v0.2.1 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/metric v1.17.0 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
google.golang.org/protobuf v1.30.0 // indirect
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
)
Loading

0 comments on commit d52ca92

Please sign in to comment.