diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0dbf61c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,104 @@ +## Report Issues on GitHub [Issues](https://github.com/qdrant/go-client/issues) + +We track public bugs and feature requests using GitHub issues. Please report by [opening a new issue](https://github.com/qdrant/go-client/issues/new). + +**Effective Bug Reports** should include: + +- A clear summary or background +- Steps to reproduce the issue + - Be as specific as possible + - Include sample code when possible +- What you expect to happen +- What happened +- Additional notes (e.g., why you think the issue occurs or solutions you’ve tried that didn’t work) + +## Contributing Code + +Follow these steps before submitting a pull request: + +### Building the Project + +```bash +go build ./... +``` + +This will download all dependencies and compile the project. + +### Running Tests + +All test files are in the `qdrant_test` directory and use [Testcontainers Go](https://golang.testcontainers.org/) for integration tests. + +Run the following command to execute the test suites: + +```bash +go test -v ./... +``` + +This command pulls a Qdrant Docker image to run integration tests. Ensure Docker is running. + +### Formatting and Linting + +Ensure your code is free from warnings and follows project standards. + +The project uses [Gofmt](https://go.dev/blog/gofmt) for formatting and [golangci-lint](https://github.com/golangci/golangci-lint) for linting. + +To format your code: + +```bash +gofmt -s -w . +``` + +To lint your code: + +```bash +golangci-lint run +``` + +### Preparing for a New Release + +The client uses generated stubs from upstream Qdrant proto definitions, which are downloaded from [qdrant/qdrant](https://github.com/qdrant/qdrant/tree/master/lib/api/src/grpc/proto). + +#### Steps: + +1. Download and generate the latest client stubs by running the following command from the project root: + +```bash +BRANCH=dev sh tools/sync_proto.sh +``` + +2. Update the test image value in [`qdrant_test/image_test.go`](https://github.com/qdrant/go-client/blob/new-client/qdrant_test/image_test.go) to `qdrant/qdrant:dev`. + +3. Remove the gRPC server definitions from the auto-generated code. + +There is currently [no way](https://github.com/golang/protobuf/issues/373) to skip generating Go server definitions. + +You’ll need to manually delete them from [`snapshots_service_grpc.pb.go`](https://github.com/qdrant/go-client/blob/new-client/qdrant/snapshots_service_grpc.pb.go), [`points_service_grpc.pb.go`](https://github.com/qdrant/go-client/blob/new-client/qdrant/points_service.pb.go), and [`collections_service_grpc.pb.go`](https://github.com/qdrant/go-client/blob/new-client/qdrant/collections_service_grpc.pb.go). + +Remove lines starting from comments like `// CollectionsServer is the server API for Collections service.` until the end of the file. [Here’s an example commit](https://github.com/qdrant/go-client/commit/6d04e31bb2acccf54f964a634df8930533642892). + +4. Implement new Qdrant methods in [`points.go`](https://github.com/qdrant/go-client/blob/new-client/qdrant/points.go), [`collections.go`](https://github.com/qdrant/go-client/blob/new-client/qdrant/collections.go), or [`qdrant.go`](https://github.com/qdrant/go-client/blob/new-client/qdrant/qdrant.go) as needed. + +5. If there are any new `oneOf` properties in the proto definitions, add helper constructors in [`oneof_factory.go`](https://github.com/qdrant/go-client/blob/new-client/qdrant/oneof_factory.go) following the existing patterns. + +6. Submit your pull request and get those approvals. + +### Releasing a New Version + +Once the new Qdrant version is live: + +1. Run the following command: + +```bash +BRANCH=master sh tools/sync_proto.sh +``` + +2. Update the test image value in `qdrant_test/image_test.go` to `qdrant/qdrant:NEW_VERSION`. + +3. Merge the pull request. + +4. Push a new Git tag to publish the version: + +```bash +git tag v1.11.0 +git push --tags +``` diff --git a/README.md b/README.md index f73b617..58267b9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,135 @@ -# Qdrant-Go V2 +
+ +
-TODO ++ Go client for the Qdrant vector search engine. +
+ + + +Go client library with handy utilities for interfacing with [Qdrant](https://qdrant.tech/). + +## 📥 Installation + +```bash +go get -u github.com/qdrant/go-client +``` + +## 📖 Documentation + +- Usage examples are available throughout the [Qdrant documentation](https://qdrant.tech/documentation/quick-start/) and [API Reference](https://api.qdrant.tech/). +- [Godoc Reference](https://pkg.go.dev/github.com/qdrant/go-client) + +## 🔌 Getting started + +### Creating a client + +A client can be instantiated with + +```go +import "github.com/qdrant/go-client/qdrant" + +client, err := qdrant.NewClient(&qdrant.Config{ + Host: "localhost", + Port: 6334, +}) +``` + +Which creates a client that will connect to Qdrant on