diff --git a/.golangci.yml b/.golangci.yml index f0ff7d329..2e41e6152 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -12,6 +12,7 @@ formatters: local-prefixes: - github.com/gocql/gocql - github.com/apache/cassandra-gocql-driver + - github.com/apache/cassandra-gocql-driver/v2 golines: max-len: 120 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fd3e71c6..1e550f830 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Moved the Snappy compressor into its own separate package (CASSGO-33) - - Move lz4 compressor to lz4 package within the gocql module (CASSGO-32) - Don't restrict server authenticator unless PasswordAuthentictor.AllowedAuthenticators is provided (CASSGO-19) - Detailed description for NumConns (CASSGO-3) @@ -51,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changes to Query and Batch to make them safely reusable (CASSGO-22) - Change logger interface so it supports structured logging and log levels (CASSGO-9) - Bump go version in go.mod to 1.19 (CASSGO-34) +- Change module name to github.com/apache/cassandra-gocql-driver/v2 (CASSGO-70) ### Fixed diff --git a/README.md b/README.md index 24dfe63c1..5144caf29 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,13 @@ Apache Cassandra GoCQL Driver [!Join the chat at https://the-asf.slack.com/archives/C05LPRVNZV1](https://the-asf.slack.com/archives/C05LPRVNZV1) ![go build](https://github.com/apache/cassandra-gocql-driver/actions/workflows/main.yml/badge.svg) -[![GoDoc](https://godoc.org/github.com/gocql/gocql?status.svg)](https://godoc.org/github.com/gocql/gocql) +[![GoDoc](https://pkg.go.dev/github.com/apache/cassandra-gocql-driver/v2?status.svg)](https://pkg.go.dev/github.com/apache/cassandra-gocql-driver/v2) Package gocql implements a fast and robust Cassandra client for the Go programming language. Project Website: https://cassandra.apache.org
-API documentation: https://godoc.org/github.com/gocql/gocql
+API documentation: https://pkg.go.dev/github.com/apache/cassandra-gocql-driver/v2
Discussions: https://cassandra.apache.org/_/community.html#discussions Supported Versions @@ -17,7 +17,7 @@ Supported Versions The following matrix shows the versions of Go and Cassandra that are tested with the integration test suite as part of the CI build: -| Go/Cassandra | 4.0.x | 4.1.x | +| Go/Cassandra | 4.1.x | 5.0.x | |--------------|-------|-------| | 1.22 | yes | yes | | 1.23 | yes | yes | @@ -33,7 +33,7 @@ In general, the Cassandra community will focus on supporting the current and pre Installation ------------ - go get github.com/gocql/gocql + go get github.com/apache/cassandra-gocql-driver/v2 Features @@ -115,7 +115,7 @@ statement. Example ------- -See [package documentation](https://pkg.go.dev/github.com/gocql/gocql#pkg-examples). +See [package documentation](https://pkg.go.dev/github.com/apache/cassandra-gocql-driver/v2#pkg-examples). Data Binding ------------ diff --git a/common_test.go b/common_test.go index 27f5b9595..299af3b38 100644 --- a/common_test.go +++ b/common_test.go @@ -39,8 +39,8 @@ import ( "testing" "time" - "github.com/gocql/gocql/lz4" - "github.com/gocql/gocql/snappy" + "github.com/apache/cassandra-gocql-driver/v2/lz4" + "github.com/apache/cassandra-gocql-driver/v2/snappy" ) var ( diff --git a/conn.go b/conn.go index f80d7ca27..6cfb6fe9a 100644 --- a/conn.go +++ b/conn.go @@ -40,8 +40,8 @@ import ( "sync/atomic" "time" - "github.com/gocql/gocql/internal/lru" - "github.com/gocql/gocql/internal/streams" + "github.com/apache/cassandra-gocql-driver/v2/internal/lru" + "github.com/apache/cassandra-gocql-driver/v2/internal/streams" ) // approve the authenticator with the list of allowed authenticators. If the provided list is empty, diff --git a/conn_test.go b/conn_test.go index 0a3bc69bb..d3271acca 100644 --- a/conn_test.go +++ b/conn_test.go @@ -50,7 +50,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/gocql/gocql/internal/streams" + "github.com/apache/cassandra-gocql-driver/v2/internal/streams" ) const ( diff --git a/control_ccm_test.go b/control_ccm_test.go index 426a59aef..4271fd7fe 100644 --- a/control_ccm_test.go +++ b/control_ccm_test.go @@ -33,7 +33,7 @@ import ( "testing" "time" - "github.com/gocql/gocql/internal/ccm" + "github.com/apache/cassandra-gocql-driver/v2/internal/ccm" ) type TestHostFilter struct { diff --git a/doc.go b/doc.go index f6e7b28f9..620386d09 100644 --- a/doc.go +++ b/doc.go @@ -387,4 +387,4 @@ // system_traces.events tables. NewTraceWriter returns an implementation of Tracer that writes the events to a writer. // Gathering trace information might be essential for debugging and optimizing queries, but writing traces has overhead, // so this feature should not be used on production systems with very high load unless you know what you are doing. -package gocql // import "github.com/gocql/gocql" +package gocql // import "github.com/apache/cassandra-gocql-driver/v2" diff --git a/events_ccm_test.go b/events_ccm_test.go index 6c605d79d..bfc3c9f54 100644 --- a/events_ccm_test.go +++ b/events_ccm_test.go @@ -32,7 +32,7 @@ import ( "testing" "time" - "github.com/gocql/gocql/internal/ccm" + "github.com/apache/cassandra-gocql-driver/v2/internal/ccm" ) func TestEventDiscovery(t *testing.T) { diff --git a/example_batch_test.go b/example_batch_test.go index b5de6be40..9f778c847 100644 --- a/example_batch_test.go +++ b/example_batch_test.go @@ -29,7 +29,7 @@ import ( "fmt" "log" - "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) // Example_batch demonstrates how to execute a batch of statements. diff --git a/example_dynamic_columns_test.go b/example_dynamic_columns_test.go index eab17528e..984bc730d 100644 --- a/example_dynamic_columns_test.go +++ b/example_dynamic_columns_test.go @@ -32,7 +32,7 @@ import ( "reflect" "text/tabwriter" - gocql "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) // Example_dynamicColumns demonstrates how to handle dynamic column list. diff --git a/example_lwt_batch_test.go b/example_lwt_batch_test.go index 8f6399a98..c65ce9618 100644 --- a/example_lwt_batch_test.go +++ b/example_lwt_batch_test.go @@ -29,7 +29,7 @@ import ( "fmt" "log" - "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) // ExampleSession_MapExecuteBatchCAS demonstrates how to execute a batch lightweight transaction. diff --git a/example_lwt_test.go b/example_lwt_test.go index 7ca0fb8ba..17dc3c29e 100644 --- a/example_lwt_test.go +++ b/example_lwt_test.go @@ -29,7 +29,7 @@ import ( "fmt" "log" - gocql "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) // ExampleQuery_MapScanCAS demonstrates how to execute a single-statement lightweight transaction. diff --git a/example_marshaler_test.go b/example_marshaler_test.go index 323ebd241..fce4ded05 100644 --- a/example_marshaler_test.go +++ b/example_marshaler_test.go @@ -31,7 +31,7 @@ import ( "strconv" "strings" - gocql "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) // MyMarshaler implements Marshaler and Unmarshaler. diff --git a/example_nulls_test.go b/example_nulls_test.go index e288c99d3..4d0ab162b 100644 --- a/example_nulls_test.go +++ b/example_nulls_test.go @@ -28,7 +28,7 @@ import ( "fmt" "log" - gocql "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) // Example_nulls demonstrates how to distinguish between null and zero value when needed. diff --git a/example_paging_test.go b/example_paging_test.go index 1ddc4ceef..8e2a12398 100644 --- a/example_paging_test.go +++ b/example_paging_test.go @@ -28,7 +28,7 @@ import ( "fmt" "log" - gocql "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) // Example_paging demonstrates how to manually fetch pages and use page state. diff --git a/example_set_test.go b/example_set_test.go index 76a97f8b1..faf73ea94 100644 --- a/example_set_test.go +++ b/example_set_test.go @@ -29,7 +29,7 @@ import ( "log" "sort" - gocql "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) // Example_set demonstrates how to use sets. diff --git a/example_test.go b/example_test.go index 35ea051a0..0fd432ed9 100644 --- a/example_test.go +++ b/example_test.go @@ -29,7 +29,7 @@ import ( "fmt" "log" - gocql "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) func Example() { diff --git a/example_udt_map_test.go b/example_udt_map_test.go index 03b98cc7a..099008adc 100644 --- a/example_udt_map_test.go +++ b/example_udt_map_test.go @@ -29,7 +29,7 @@ import ( "fmt" "log" - gocql "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) // Example_userDefinedTypesMap demonstrates how to work with user-defined types as maps. diff --git a/example_udt_marshaler_test.go b/example_udt_marshaler_test.go index 1b24f2a85..3e20cacd6 100644 --- a/example_udt_marshaler_test.go +++ b/example_udt_marshaler_test.go @@ -28,7 +28,7 @@ import ( "context" "log" - gocql "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) // MyUDTMarshaler implements UDTMarshaler. diff --git a/example_udt_struct_test.go b/example_udt_struct_test.go index d5045d6a9..1038741c3 100644 --- a/example_udt_struct_test.go +++ b/example_udt_struct_test.go @@ -29,7 +29,7 @@ import ( "fmt" "log" - gocql "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) type MyUDT struct { diff --git a/example_udt_unmarshaler_test.go b/example_udt_unmarshaler_test.go index 9d4d2932a..3467b161d 100644 --- a/example_udt_unmarshaler_test.go +++ b/example_udt_unmarshaler_test.go @@ -29,7 +29,7 @@ import ( "fmt" "log" - gocql "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) // MyUDTUnmarshaler implements UDTUnmarshaler. diff --git a/go.mod b/go.mod index d079507ea..f0428c40e 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -module github.com/gocql/gocql +module github.com/apache/cassandra-gocql-driver/v2 require ( github.com/golang/snappy v0.0.3 diff --git a/gocqlzap/zap.go b/gocqlzap/zap.go index 0b7dbfcd1..142510578 100644 --- a/gocqlzap/zap.go +++ b/gocqlzap/zap.go @@ -21,7 +21,7 @@ package gocqlzap import ( "go.uber.org/zap" - "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) const DefaultName = "gocql" diff --git a/gocqlzap/zap_test.go b/gocqlzap/zap_test.go index 7ac0fb6d3..f64a378b5 100644 --- a/gocqlzap/zap_test.go +++ b/gocqlzap/zap_test.go @@ -30,7 +30,7 @@ import ( "go.uber.org/zap" "go.uber.org/zap/zapcore" - "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) const logLineEnding = "%%%\n%%%" diff --git a/gocqlzerolog/zerolog.go b/gocqlzerolog/zerolog.go index ee2e70213..e9435855f 100644 --- a/gocqlzerolog/zerolog.go +++ b/gocqlzerolog/zerolog.go @@ -21,7 +21,7 @@ package gocqlzerolog import ( "github.com/rs/zerolog" - "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) const DefaultName = "gocql" diff --git a/gocqlzerolog/zerolog_test.go b/gocqlzerolog/zerolog_test.go index 66c54961a..e5eca3e00 100644 --- a/gocqlzerolog/zerolog_test.go +++ b/gocqlzerolog/zerolog_test.go @@ -28,7 +28,7 @@ import ( "github.com/rs/zerolog" - "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) const logLineEnding = "%%%\n%%%" diff --git a/host_source_gen.go b/host_source_gen.go index d4999d6c9..6be974619 100644 --- a/host_source_gen.go +++ b/host_source_gen.go @@ -32,7 +32,7 @@ import ( "reflect" "sync" - gocql "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) func gen(clause, field string) { diff --git a/host_source_test.go b/host_source_test.go index 07086e680..0d6114291 100644 --- a/host_source_test.go +++ b/host_source_test.go @@ -453,7 +453,7 @@ func TestRefreshDebouncer_EventsAfterRefreshNow(t *testing.T) { } } -// https://github.com/gocql/gocql/issues/1752 +// https://github.com/apache/cassandra-gocql-driver/issues/1752 func TestRefreshDebouncer_DeadlockOnStop(t *testing.T) { // there's no way to guarantee this bug manifests because it depends on which `case` is picked from the `select` // with 4 iterations of this test the deadlock would be hit pretty consistently diff --git a/hostpool/hostpool.go b/hostpool/hostpool.go index c821a1c61..bc250c0e0 100644 --- a/hostpool/hostpool.go +++ b/hostpool/hostpool.go @@ -23,7 +23,7 @@ import ( "github.com/hailocab/go-hostpool" - "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) // HostPoolHostPolicy is a host policy which uses the bitly/go-hostpool library diff --git a/hostpool/hostpool_test.go b/hostpool/hostpool_test.go index eb374d9ab..82b63def2 100644 --- a/hostpool/hostpool_test.go +++ b/hostpool/hostpool_test.go @@ -28,7 +28,7 @@ import ( "github.com/hailocab/go-hostpool" - "github.com/gocql/gocql" + gocql "github.com/apache/cassandra-gocql-driver/v2" ) func TestHostPolicy_HostPool(t *testing.T) { diff --git a/prepared_cache.go b/prepared_cache.go index 7f5533a2d..2db8bfe91 100644 --- a/prepared_cache.go +++ b/prepared_cache.go @@ -28,7 +28,7 @@ import ( "bytes" "sync" - "github.com/gocql/gocql/internal/lru" + "github.com/apache/cassandra-gocql-driver/v2/internal/lru" ) const defaultMaxPreparedStmts = 1000 diff --git a/session.go b/session.go index 606c68f4b..b1e3e4fcc 100644 --- a/session.go +++ b/session.go @@ -38,7 +38,7 @@ import ( "time" "unicode" - "github.com/gocql/gocql/internal/lru" + "github.com/apache/cassandra-gocql-driver/v2/internal/lru" ) // Session is the interface used by users to interact with the database. diff --git a/snappy/compressor.go b/snappy/compressor.go index faec4a722..80276870f 100644 --- a/snappy/compressor.go +++ b/snappy/compressor.go @@ -1,3 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * Content before git sha 34fdeebefcbf183ed7f916f931aa0586fdaa1b40 + * Copyright (c) 2012, The Gocql authors, + * provided under the BSD-3-Clause License. + * See the NOTICE file distributed with this work for additional information. + */ + package snappy import "github.com/golang/snappy" diff --git a/token.go b/token.go index 7502ea713..83f747df0 100644 --- a/token.go +++ b/token.go @@ -37,7 +37,7 @@ import ( "strconv" "strings" - "github.com/gocql/gocql/internal/murmur" + "github.com/apache/cassandra-gocql-driver/v2/internal/murmur" ) // a token partitioner diff --git a/version.go b/version.go index f2250f7fe..73484e70e 100644 --- a/version.go +++ b/version.go @@ -33,7 +33,7 @@ const ( // current main package returned by runtime/debug below. Also note the // package name used here may change in a future (2.x) release; in that case // this constant will be updated as well. - mainPackage = "github.com/gocql/gocql" + mainPackage = "github.com/apache/cassandra-gocql-driver/v2" ) var driverName string