Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moved internal clients into internal/client package #896

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ jobs:

- name: Install utilities
run: |
go install mvdan.cc/gofumpt@v0.3.1
go install github.com/rinchsan/gosimports/cmd/gosimports@v0.1.5
go install mvdan.cc/gofumpt@v0.5.0
go install github.com/rinchsan/gosimports/cmd/gosimports@v0.3.8

- name: format all files with auto-formatter
run: bash ./.github/scripts/format-all-go-code.sh "$PWD"
Expand Down
50 changes: 25 additions & 25 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ import (
"github.com/ydb-platform/ydb-go-sdk/v3/coordination"
"github.com/ydb-platform/ydb-go-sdk/v3/discovery"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/coordinationImpl"
coordinationConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/coordinationImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/discoveryImpl"
discoveryConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/discoveryImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/ratelimiterImpl"
ratelimiterConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/ratelimiterImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/schemeImpl"
schemeConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/schemeImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/scriptingImpl"
scriptingConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/scriptingImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/tableImpl"
tableConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/tableImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/topicImpl/topicclientinternal"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/conn"
internalCoordination "github.com/ydb-platform/ydb-go-sdk/v3/internal/coordination"
coordinationConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/coordination/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/credentials"
internalDiscovery "github.com/ydb-platform/ydb-go-sdk/v3/internal/discovery"
discoveryConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/discovery/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/dsn"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/endpoint"
internalRatelimiter "github.com/ydb-platform/ydb-go-sdk/v3/internal/ratelimiter"
ratelimiterConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/ratelimiter/config"
internalScheme "github.com/ydb-platform/ydb-go-sdk/v3/internal/scheme"
schemeConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/scheme/config"
internalScripting "github.com/ydb-platform/ydb-go-sdk/v3/internal/scripting"
scriptingConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/scripting/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/stack"
internalTable "github.com/ydb-platform/ydb-go-sdk/v3/internal/table"
tableConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/table/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/topic/topicclientinternal"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xsql"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xsync"
Expand Down Expand Up @@ -58,22 +58,22 @@ type Driver struct { //nolint:maligned
config *config.Config
options []config.Option

discovery *internalDiscovery.Client
discovery *discoveryImpl.Client
discoveryOptions []discoveryConfig.Option

table *internalTable.Client
table *tableImpl.Client
tableOptions []tableConfig.Option

scripting *internalScripting.Client
scripting *scriptingImpl.Client
scriptingOptions []scriptingConfig.Option

scheme *internalScheme.Client
scheme *schemeImpl.Client
schemeOptions []schemeConfig.Option

coordination *internalCoordination.Client
coordination *coordinationImpl.Client
coordinationOptions []coordinationConfig.Option

ratelimiter *internalRatelimiter.Client
ratelimiter *ratelimiterImpl.Client
ratelimiterOptions []ratelimiterConfig.Option

topic *topicclientinternal.Client
Expand Down Expand Up @@ -355,7 +355,7 @@ func (d *Driver) connect(ctx context.Context) (err error) {
return xerrors.WithStackTrace(err)
}

d.table, err = internalTable.New(ctx,
d.table, err = tableImpl.New(ctx,
d.balancer,
tableConfig.New(
append(
Expand All @@ -371,7 +371,7 @@ func (d *Driver) connect(ctx context.Context) (err error) {
return xerrors.WithStackTrace(err)
}

d.scheme, err = internalScheme.New(ctx,
d.scheme, err = schemeImpl.New(ctx,
d.balancer,
schemeConfig.New(
append(
Expand All @@ -388,7 +388,7 @@ func (d *Driver) connect(ctx context.Context) (err error) {
return xerrors.WithStackTrace(err)
}

d.coordination, err = internalCoordination.New(ctx,
d.coordination, err = coordinationImpl.New(ctx,
d.balancer,
coordinationConfig.New(
append(
Expand All @@ -404,7 +404,7 @@ func (d *Driver) connect(ctx context.Context) (err error) {
return xerrors.WithStackTrace(err)
}

d.ratelimiter, err = internalRatelimiter.New(ctx,
d.ratelimiter, err = ratelimiterImpl.New(ctx,
d.balancer,
ratelimiterConfig.New(
append(
Expand All @@ -420,7 +420,7 @@ func (d *Driver) connect(ctx context.Context) (err error) {
return xerrors.WithStackTrace(err)
}

d.discovery, err = internalDiscovery.New(ctx,
d.discovery, err = discoveryImpl.New(ctx,
d.pool.Get(endpoint.New(d.config.Endpoint())),
discoveryConfig.New(
append(
Expand All @@ -440,7 +440,7 @@ func (d *Driver) connect(ctx context.Context) (err error) {
return xerrors.WithStackTrace(err)
}

d.scripting, err = internalScripting.New(ctx,
d.scripting, err = scriptingImpl.New(ctx,
d.balancer,
scriptingConfig.New(
append(
Expand Down
2 changes: 1 addition & 1 deletion errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/ydb-platform/ydb-go-genproto/protos/Ydb"
grpcCodes "google.golang.org/grpc/codes"

ratelimiterErrors "github.com/ydb-platform/ydb-go-sdk/v3/internal/ratelimiter/errors"
ratelimiterErrors "github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/ratelimiterImpl/errors"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
"github.com/ydb-platform/ydb-go-sdk/v3/ratelimiter"
)
Expand Down
6 changes: 3 additions & 3 deletions internal/balancer/balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (

"github.com/ydb-platform/ydb-go-sdk/v3/config"
balancerConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/discoveryImpl"
discoveryConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/discoveryImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/closer"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/conn"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/credentials"
internalDiscovery "github.com/ydb-platform/ydb-go-sdk/v3/internal/discovery"
discoveryConfig "github.com/ydb-platform/ydb-go-sdk/v3/internal/discovery/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/endpoint"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/repeater"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/stack"
Expand Down Expand Up @@ -253,7 +253,7 @@ func New(
pool: pool,
localDCDetector: detectLocalDC,
}
d, err := internalDiscovery.New(ctx, pool.Get(
d, err := discoveryImpl.New(ctx, pool.Get(
endpoint.New(driverConfig.Endpoint()),
), discoveryConfig)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package coordination
package coordinationImpl

Check warning on line 1 in internal/clients/coordinationImpl/client.go

View workflow job for this annotation

GitHub Actions / golangci-lint

var-naming: don't use MixedCaps in package name; coordinationImpl should be coordinationimpl (revive)

import (
"context"
Expand All @@ -9,18 +9,14 @@
"google.golang.org/grpc"

"github.com/ydb-platform/ydb-go-sdk/v3/coordination"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/coordination/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/coordinationImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/operation"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
"github.com/ydb-platform/ydb-go-sdk/v3/retry"
"github.com/ydb-platform/ydb-go-sdk/v3/scheme"
)

//nolint:gofumpt
//nolint:nolintlint
var (
errNilClient = xerrors.Wrap(errors.New("coordination client is not initialized"))
)
var errNilClient = xerrors.Wrap(errors.New("coordination client is not initialized"))

type Client struct {
config config.Config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package discovery
package discoveryImpl

Check warning on line 1 in internal/clients/discoveryImpl/discovery.go

View workflow job for this annotation

GitHub Actions / golangci-lint

var-naming: don't use MixedCaps in package name; discoveryImpl should be discoveryimpl (revive)

import (
"context"
Expand All @@ -12,7 +12,7 @@
"google.golang.org/grpc"

"github.com/ydb-platform/ydb-go-sdk/v3/discovery"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/discovery/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/discoveryImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/endpoint"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/stack"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ratelimiter
package ratelimiterImpl

Check warning on line 1 in internal/clients/ratelimiterImpl/client.go

View workflow job for this annotation

GitHub Actions / golangci-lint

var-naming: don't use MixedCaps in package name; ratelimiterImpl should be ratelimiterimpl (revive)

import (
"context"
Expand All @@ -10,10 +10,10 @@
"github.com/ydb-platform/ydb-go-genproto/protos/Ydb_RateLimiter"
"google.golang.org/grpc"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/ratelimiterImpl/config"
ratelimiterErrors "github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/ratelimiterImpl/errors"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/ratelimiterImpl/options"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/operation"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/ratelimiter/config"
ratelimiterErrors "github.com/ydb-platform/ydb-go-sdk/v3/internal/ratelimiter/errors"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/ratelimiter/options"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
"github.com/ydb-platform/ydb-go-sdk/v3/ratelimiter"
"github.com/ydb-platform/ydb-go-sdk/v3/retry"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scheme
package schemeImpl

Check warning on line 1 in internal/clients/schemeImpl/client.go

View workflow job for this annotation

GitHub Actions / golangci-lint

var-naming: don't use MixedCaps in package name; schemeImpl should be schemeimpl (revive)

import (
"context"
Expand All @@ -8,8 +8,8 @@
"github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Scheme"
"google.golang.org/grpc"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/schemeImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/operation"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/scheme/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/stack"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
"github.com/ydb-platform/ydb-go-sdk/v3/retry"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scheme
package schemeImpl

Check warning on line 1 in internal/clients/schemeImpl/options.go

View workflow job for this annotation

GitHub Actions / golangci-lint

var-naming: don't use MixedCaps in package name; schemeImpl should be schemeimpl (revive)

import "github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Scheme"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scheme
package schemeImpl

Check warning on line 1 in internal/clients/schemeImpl/options_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

var-naming: don't use MixedCaps in package name; schemeImpl should be schemeimpl (revive)

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scripting
package scriptingImpl

import (
"context"
Expand All @@ -11,10 +11,10 @@ import (
"google.golang.org/grpc"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/allocator"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/scriptingImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/tableImpl/scanner"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/operation"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/scripting/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/stack"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/table/scanner"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/value"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xcontext"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package table
package tableImpl

import (
"container/list"
Expand All @@ -10,9 +10,9 @@ import (
"github.com/jonboulle/clockwork"
"google.golang.org/grpc"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/tableImpl/config"
metaHeaders "github.com/ydb-platform/ydb-go-sdk/v3/internal/meta"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/stack"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/table/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xcontext"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xsync"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package table
package tableImpl

import (
"context"
Expand All @@ -18,7 +18,7 @@ import (
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/emptypb"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/table/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/tableImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xatomic"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xcontext"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package table
package tableImpl

import (
"github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Table"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package table
package tableImpl

import (
"errors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package table
package tableImpl

import (
"bytes"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package table
package tableImpl

import (
"context"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/table/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/tableImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xcontext"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
"github.com/ydb-platform/ydb-go-sdk/v3/retry"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package table
package tableImpl

import (
"context"
Expand All @@ -11,7 +11,7 @@ import (
grpcCodes "google.golang.org/grpc/codes"
grpcStatus "google.golang.org/grpc/status"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/table/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/tableImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xcontext"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xrand"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package table
package tableImpl

import (
"context"
Expand All @@ -17,13 +17,13 @@ import (

"github.com/ydb-platform/ydb-go-sdk/v3/internal/allocator"
balancerContext "github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/tableImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/tableImpl/scanner"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/conn"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/feature"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/meta"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/operation"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/stack"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/table/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/table/scanner"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/value"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xatomic"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xcontext"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package table
package tableImpl

import (
"context"
Expand All @@ -20,8 +20,8 @@ import (
"google.golang.org/protobuf/types/known/durationpb"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/allocator"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/clients/tableImpl/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/operation"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/table/config"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/value"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xcontext"
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package table
package tableImpl

import (
"context"
Expand Down
Loading
Loading