Skip to content

Commit

Permalink
rename package to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
zerospiel committed Jul 21, 2020
1 parent 57ab825 commit eb06126
Show file tree
Hide file tree
Showing 570 changed files with 1,462 additions and 1,460 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: go
go_import_path: github.com/ozonru/etcd
go_import_path: github.com/ozonru/etcd/v3

sudo: required

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG-3.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ See [code changes](https://github.com/etcd-io/etcd/compare/v3.4.0...v3.5.0) and

### Breaking Changes

- `go.etcd.io/etcd` Go packages have moved to `github.com/ozonru/etcd` to follow the [Go modules](https://github.com/golang/go/wiki/Modules) conventions
- `go.etcd.io/etcd` Go packages have moved to `github.com/ozonru/etcd/v3` to follow the [Go modules](https://github.com/golang/go/wiki/Modules) conventions
- Changed behavior of clienv3 API [MemberList](https://github.com/etcd-io/etcd/pull/11639).
- Previously, it is directly served with server's local data, which could be stale.
- Now, it is served with linearizable guarantee. If the server is disconnected from quorum, `MemberList` call will fail.
Expand Down
4 changes: 2 additions & 2 deletions Documentation/dev-guide/grpc_naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ The etcd client provides a gRPC resolver for resolving gRPC endpoints with an et

```go
import (
"github.com/ozonru/etcd/clientv3"
etcdnaming "github.com/ozonru/etcd/clientv3/naming"
"github.com/ozonru/etcd/v3/clientv3"
etcdnaming "github.com/ozonru/etcd/v3/clientv3/naming"

"google.golang.org/grpc"
)
Expand Down
4 changes: 2 additions & 2 deletions Documentation/dl-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ To build a vendored `etcd` from the `master` branch via `go get`:
# GOPATH should be set
$ echo $GOPATH
/Users/example/go
$ go get -v github.com/ozonru/etcd
$ go get -v github.com/ozonru/etcd/etcdctl
$ go get -v github.com/ozonru/etcd/v3
$ go get -v github.com/ozonru/etcd/v3/etcdctl
```

## Test the installation
Expand Down
4 changes: 2 additions & 2 deletions Documentation/learning/lock/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/ozonru/etcd/clientv3"
"github.com/ozonru/etcd/clientv3/concurrency"
"github.com/ozonru/etcd/v3/clientv3"
"github.com/ozonru/etcd/v3/clientv3/concurrency"
"io/ioutil"
"net/http"
"os"
Expand Down
6 changes: 3 additions & 3 deletions auth/range_perm_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
package auth

import (
"github.com/ozonru/etcd/auth/authpb"
"github.com/ozonru/etcd/mvcc/backend"
"github.com/ozonru/etcd/pkg/adt"
"github.com/ozonru/etcd/v3/auth/authpb"
"github.com/ozonru/etcd/v3/mvcc/backend"
"github.com/ozonru/etcd/v3/pkg/adt"

"go.uber.org/zap"
)
Expand Down
4 changes: 2 additions & 2 deletions auth/range_perm_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package auth
import (
"testing"

"github.com/ozonru/etcd/auth/authpb"
"github.com/ozonru/etcd/pkg/adt"
"github.com/ozonru/etcd/v3/auth/authpb"
"github.com/ozonru/etcd/v3/pkg/adt"

"go.uber.org/zap"
)
Expand Down
10 changes: 5 additions & 5 deletions auth/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import (
"sync/atomic"
"time"

"github.com/ozonru/etcd/auth/authpb"
"github.com/ozonru/etcd/etcdserver/api/v3rpc/rpctypes"
"github.com/ozonru/etcd/etcdserver/cindex"
pb "github.com/ozonru/etcd/etcdserver/etcdserverpb"
"github.com/ozonru/etcd/mvcc/backend"
"github.com/ozonru/etcd/v3/auth/authpb"
"github.com/ozonru/etcd/v3/etcdserver/api/v3rpc/rpctypes"
"github.com/ozonru/etcd/v3/etcdserver/cindex"
pb "github.com/ozonru/etcd/v3/etcdserver/etcdserverpb"
"github.com/ozonru/etcd/v3/mvcc/backend"

"go.uber.org/zap"
"golang.org/x/crypto/bcrypt"
Expand Down
8 changes: 4 additions & 4 deletions auth/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
"testing"
"time"

"github.com/ozonru/etcd/auth/authpb"
"github.com/ozonru/etcd/etcdserver/api/v3rpc/rpctypes"
pb "github.com/ozonru/etcd/etcdserver/etcdserverpb"
"github.com/ozonru/etcd/mvcc/backend"
"github.com/ozonru/etcd/v3/auth/authpb"
"github.com/ozonru/etcd/v3/etcdserver/api/v3rpc/rpctypes"
pb "github.com/ozonru/etcd/v3/etcdserver/etcdserverpb"
"github.com/ozonru/etcd/v3/mvcc/backend"

"go.uber.org/zap"
"golang.org/x/crypto/bcrypt"
Expand Down
2 changes: 1 addition & 1 deletion bill-of-materials.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@
]
},
{
"project": "github.com/ozonru/etcd",
"project": "github.com/ozonru/etcd/v3",
"licenses": [
{
"type": "Apache License 2.0",
Expand Down
2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# set some environment variables
ORG_PATH="github.com/ozonru"
REPO_PATH="${ORG_PATH}/etcd"
REPO_PATH="${ORG_PATH}/etcd/v3"

GIT_SHA=$(git rev-parse --short HEAD || echo "GitNotFound")
if [[ -n "$FAILPOINTS" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For full compatibility, it is recommended to vendor builds using etcd's vendored
## Install

```bash
go get github.com/ozonru/etcd/client
go get github.com/ozonru/etcd/v3/client
```

## Usage
Expand All @@ -22,7 +22,7 @@ import (
"time"
"context"

"github.com/ozonru/etcd/client"
"github.com/ozonru/etcd/v3/client"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"sync"
"time"

"github.com/ozonru/etcd/version"
"github.com/ozonru/etcd/v3/version"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"testing"
"time"

"github.com/ozonru/etcd/pkg/testutil"
"github.com/ozonru/etcd/version"
"github.com/ozonru/etcd/v3/pkg/testutil"
"github.com/ozonru/etcd/v3/version"
)

type actionAssertingHTTPClient struct {
Expand Down
2 changes: 1 addition & 1 deletion client/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package client

import (
"github.com/ozonru/etcd/pkg/srv"
"github.com/ozonru/etcd/v3/pkg/srv"
)

// Discoverer is an interface that wraps the Discover method.
Expand Down
2 changes: 1 addition & 1 deletion client/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Create a Config and exchange it for a Client:
"net/http"
"context"
"github.com/ozonru/etcd/client"
"github.com/ozonru/etcd/v3/client"
)
cfg := client.Config{
Expand Down
2 changes: 1 addition & 1 deletion client/example_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"log"
"sort"

"github.com/ozonru/etcd/client"
"github.com/ozonru/etcd/v3/client"
)

func ExampleKeysAPI_directory() {
Expand Down
6 changes: 3 additions & 3 deletions client/integration/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"sync/atomic"
"testing"

"github.com/ozonru/etcd/client"
"github.com/ozonru/etcd/integration"
"github.com/ozonru/etcd/pkg/testutil"
"github.com/ozonru/etcd/v3/client"
"github.com/ozonru/etcd/v3/integration"
"github.com/ozonru/etcd/v3/pkg/testutil"
)

// TestV2NoRetryEOF tests destructive api calls won't retry on a disconnection.
Expand Down
2 changes: 1 addition & 1 deletion client/integration/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"
"testing"

"github.com/ozonru/etcd/pkg/testutil"
"github.com/ozonru/etcd/v3/pkg/testutil"
)

func TestMain(m *testing.M) {
Expand Down
2 changes: 1 addition & 1 deletion client/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/ozonru/etcd/pkg/pathutil"
"github.com/ozonru/etcd/v3/pkg/pathutil"
"net/http"
"net/url"
"strconv"
Expand Down
6 changes: 3 additions & 3 deletions client/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"testing"
"time"

"github.com/ozonru/etcd/integration"
"github.com/ozonru/etcd/pkg/testutil"
"github.com/ozonru/etcd/pkg/transport"
"github.com/ozonru/etcd/v3/integration"
"github.com/ozonru/etcd/v3/pkg/testutil"
"github.com/ozonru/etcd/v3/pkg/transport"
)

var exampleEndpoints []string
Expand Down
2 changes: 1 addition & 1 deletion client/members.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"net/url"
"path"

"github.com/ozonru/etcd/pkg/types"
"github.com/ozonru/etcd/v3/pkg/types"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion client/members_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"reflect"
"testing"

"github.com/ozonru/etcd/pkg/types"
"github.com/ozonru/etcd/v3/pkg/types"
)

func TestMembersAPIActionList(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions clientv3/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"fmt"
"strings"

"github.com/ozonru/etcd/auth/authpb"
pb "github.com/ozonru/etcd/etcdserver/etcdserverpb"
"github.com/ozonru/etcd/v3/auth/authpb"
pb "github.com/ozonru/etcd/v3/etcdserver/etcdserverpb"
"google.golang.org/grpc"
)

Expand Down
20 changes: 11 additions & 9 deletions clientv3/balancer/balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"sync"
"time"

"github.com/ozonru/etcd/clientv3/balancer/connectivity"
"github.com/ozonru/etcd/clientv3/balancer/picker"
"github.com/ozonru/etcd/v3/clientv3/balancer/connectivity"
"github.com/ozonru/etcd/v3/clientv3/balancer/picker"

"go.uber.org/zap"
"google.golang.org/grpc/balancer"
Expand Down Expand Up @@ -75,7 +75,7 @@ type builder struct {

// Build is called initially when creating "ccBalancerWrapper".
// "grpc.Dial" is called to this client connection.
// Then, resolved addresses will be handled via "HandleResolvedAddrs".
// Then, resolved addresses will be handled via "UpdateClientConnState".
func (b *builder) Build(cc balancer.ClientConn, opt balancer.BuildOptions) balancer.Balancer {
bb := &baseBalancer{
id: strconv.FormatInt(time.Now().UnixNano(), 36),
Expand Down Expand Up @@ -113,12 +113,14 @@ func (b *builder) Name() string { return b.cfg.Name }

// Balancer defines client balancer interface.
type Balancer interface {
// Balancer is called on specified client connection. Client initiates gRPC
// connection with "grpc.Dial(addr, grpc.WithBalancerName)", and then those resolved
// addresses are passed to "grpc/balancer.Balancer.HandleResolvedAddrs".
// For each resolved address, balancer calls "balancer.ClientConn.NewSubConn".
// "grpc/balancer.Balancer.HandleSubConnStateChange" is called when connectivity state
// changes, thus requires failover logic in this method.
// Balancer takes input from gRPC, manages SubConns, and collects and aggregates
// the connectivity states.
//
// It also generates and updates the Picker used by gRPC to pick SubConns for RPCs.
//
// UpdateClientConnState, ResolverError, UpdateSubConnState, and Close are
// guaranteed to be called synchronously from the same goroutine. There's no
// guarantee on picker.Pick, it may be called anytime.
balancer.Balancer

// Picker calls "Pick" for every client request.
Expand Down
8 changes: 4 additions & 4 deletions clientv3/balancer/balancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"testing"
"time"

"github.com/ozonru/etcd/clientv3/balancer/picker"
"github.com/ozonru/etcd/clientv3/balancer/resolver/endpoint"
pb "github.com/ozonru/etcd/etcdserver/etcdserverpb"
"github.com/ozonru/etcd/pkg/mock/mockserver"
"github.com/ozonru/etcd/v3/clientv3/balancer/picker"
"github.com/ozonru/etcd/v3/clientv3/balancer/resolver/endpoint"
pb "github.com/ozonru/etcd/v3/etcdserver/etcdserverpb"
"github.com/ozonru/etcd/v3/pkg/mock/mockserver"

"go.uber.org/zap"
"google.golang.org/grpc"
Expand Down
12 changes: 6 additions & 6 deletions clientv3/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ import (
"time"

"github.com/google/uuid"
"github.com/ozonru/etcd/clientv3/balancer"
"github.com/ozonru/etcd/clientv3/balancer/picker"
"github.com/ozonru/etcd/clientv3/balancer/resolver/endpoint"
"github.com/ozonru/etcd/clientv3/credentials"
"github.com/ozonru/etcd/etcdserver/api/v3rpc/rpctypes"
"github.com/ozonru/etcd/pkg/logutil"
"github.com/ozonru/etcd/v3/clientv3/balancer"
"github.com/ozonru/etcd/v3/clientv3/balancer/picker"
"github.com/ozonru/etcd/v3/clientv3/balancer/resolver/endpoint"
"github.com/ozonru/etcd/v3/clientv3/credentials"
"github.com/ozonru/etcd/v3/etcdserver/api/v3rpc/rpctypes"
"github.com/ozonru/etcd/v3/pkg/logutil"
"go.uber.org/zap"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
Expand Down
4 changes: 2 additions & 2 deletions clientv3/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"testing"
"time"

"github.com/ozonru/etcd/etcdserver/api/v3rpc/rpctypes"
"github.com/ozonru/etcd/pkg/testutil"
"github.com/ozonru/etcd/v3/etcdserver/api/v3rpc/rpctypes"
"github.com/ozonru/etcd/v3/pkg/testutil"

"google.golang.org/grpc"
)
Expand Down
4 changes: 2 additions & 2 deletions clientv3/clientv3util/example_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"context"
"log"

"github.com/ozonru/etcd/clientv3"
"github.com/ozonru/etcd/clientv3/clientv3util"
"github.com/ozonru/etcd/v3/clientv3"
"github.com/ozonru/etcd/v3/clientv3/clientv3util"
)

func ExampleKeyMissing() {
Expand Down
2 changes: 1 addition & 1 deletion clientv3/clientv3util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package clientv3util

import (
"github.com/ozonru/etcd/clientv3"
"github.com/ozonru/etcd/v3/clientv3"
)

// KeyExists returns a comparison operation that evaluates to true iff the given
Expand Down
4 changes: 2 additions & 2 deletions clientv3/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package clientv3
import (
"context"

pb "github.com/ozonru/etcd/etcdserver/etcdserverpb"
"github.com/ozonru/etcd/pkg/types"
pb "github.com/ozonru/etcd/v3/etcdserver/etcdserverpb"
"github.com/ozonru/etcd/v3/pkg/types"

"google.golang.org/grpc"
)
Expand Down
2 changes: 1 addition & 1 deletion clientv3/compact_op.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package clientv3

import (
pb "github.com/ozonru/etcd/etcdserver/etcdserverpb"
pb "github.com/ozonru/etcd/v3/etcdserver/etcdserverpb"
)

// CompactOp represents a compact operation.
Expand Down
2 changes: 1 addition & 1 deletion clientv3/compact_op_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"reflect"
"testing"

"github.com/ozonru/etcd/etcdserver/etcdserverpb"
"github.com/ozonru/etcd/v3/etcdserver/etcdserverpb"
)

func TestCompactOp(t *testing.T) {
Expand Down
Loading

0 comments on commit eb06126

Please sign in to comment.