Skip to content

Commit

Permalink
test: Client Operations (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush008 authored Sep 3, 2024
1 parent 277bed6 commit a8d13f3
Show file tree
Hide file tree
Showing 16 changed files with 964 additions and 36 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Go CI
name: Go Tests

on:
push:
branches: [ master, dev ]
branches:
- master
pull_request:
branches: [ '**' ]

jobs:
build:
Expand All @@ -19,6 +19,9 @@ jobs:
with:
go-version-file: ./go.mod

- name: Get
run: go get ./...

- name: Build
run: go build ./...

Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: golangci-lint
on:
push:
branches:
- master
pull_request:

permissions:
contents: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
9 changes: 1 addition & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,7 @@ linters-settings:
# Default: []
disable:
- fieldalignment # too strict
# Settings per analyzer.
settings:
shadow:
# Whether to be strict about shadowing; can be noisy.
# Default: false
strict: true
- shadow # too noisy

inamedparam:
# Skips check for interface methods with only a single parameter.
Expand Down Expand Up @@ -245,7 +240,6 @@ linters:
- gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
- gomodguard # allow and block lists linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations
- goprintffuncname # checks that printf-like functions are named with f at the end
- gosec # inspects source code for security problems
- intrange # finds places where for loops could make use of an integer range
- lll # reports long lines
- loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap)
Expand Down Expand Up @@ -342,6 +336,5 @@ issues:
- dupl
- funlen
- goconst
- gosec
- noctx
- wrapcheck
2 changes: 1 addition & 1 deletion examples/authentication/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"log"

"github.com/qdrant/go-client-v2/qdrant"
"github.com/qdrant/go-client/qdrant"
)

func main() {
Expand Down
14 changes: 7 additions & 7 deletions examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"time"

"github.com/qdrant/go-client-v2/qdrant"
"github.com/qdrant/go-client/qdrant"
)

var (
Expand Down Expand Up @@ -71,7 +71,7 @@ func main() {
waitUpsert := true
upsertPoints := []*qdrant.PointStruct{
{
Id: qdrant.NewPointIDNum(1),
Id: qdrant.NewIDNum(1),
Vectors: qdrant.NewVectors(0.05, 0.61, 0.76, 0.74),
Payload: qdrant.NewValueMap(map[string]any{
"city": "Berlin",
Expand All @@ -81,22 +81,22 @@ func main() {
}),
},
{
Id: qdrant.NewPointIDNum(2),
Id: qdrant.NewIDNum(2),
Vectors: qdrant.NewVectors(0.19, 0.81, 0.75, 0.11),
Payload: qdrant.NewValueMap(map[string]any{
"city": "Berlin",
"country": "London",
}),
},
{
Id: qdrant.NewPointIDNum(3),
Id: qdrant.NewIDNum(3),
Vectors: qdrant.NewVectors(0.36, 0.55, 0.47, 0.94),
Payload: qdrant.NewValueMap(map[string]any{
"city": []any{"Berlin", "London"},
}),
},
{
Id: qdrant.NewPointID("58384991-3295-4e21-b711-fd3b94fa73e3"),
Id: qdrant.NewID("58384991-3295-4e21-b711-fd3b94fa73e3"),
Vectors: qdrant.NewVectors(0.35, 0.08, 0.11, 0.44),
Payload: qdrant.NewValueMap(map[string]any{
"bool": true,
Expand All @@ -119,8 +119,8 @@ func main() {
points, err := client.Get(ctx, &qdrant.GetPoints{
CollectionName: collectionName,
Ids: []*qdrant.PointId{
qdrant.NewPointIDNum(1),
qdrant.NewPointIDNum(2),
qdrant.NewIDNum(1),
qdrant.NewIDNum(2),
},
})
if err != nil {
Expand Down
55 changes: 54 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,68 @@
module github.com/qdrant/go-client-v2
module github.com/qdrant/go-client

go 1.22.2

require (
github.com/stretchr/testify v1.9.0
github.com/testcontainers/testcontainers-go v0.33.0
google.golang.org/grpc v1.66.0
google.golang.org/protobuf v1.34.2
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/containerd/containerd v1.7.18 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/creack/pty v1.1.21 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker v27.1.1+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/shirou/gopsutil/v3 v3.23.12 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/sdk v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit a8d13f3

Please sign in to comment.