mirror of
https://github.com/weaviate/weaviate-go-client.git
synced 2026-11-06 04:36:26 +00:00
No description
- Go 99.5%
- Shell 0.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .github | ||
| test | ||
| test_deprecated | ||
| tools | ||
| weaviate | ||
| .gitignore | ||
| .golangci.yml | ||
| .pre-commit-config.yaml | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTE.md | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| README.md | ||
Weaviate Go client 
A native Go client for Weaviate.
Usage
⚠️
v5.0.0cannot be installed due to a malformedgo.modfile. Preferv5.0.1or higher.
In order to get the Go client v5 issue this command:
$ go get github.com/weaviate/weaviate-go-client/v5@v5.x.x
where v5.x.x is the desired Go client v5 version, for example v5.7.4.
Add dependency to your go.mod:
require github.com/weaviate/weaviate-go-client/v5 v5.7.4
Connect to Weaviate on localhost:8080 and fetch meta information
package main
import (
"context"
"fmt"
client "github.com/weaviate/weaviate-go-client/v5/weaviate"
)
func main() {
config := client.Config{
Scheme: "http",
Host: "localhost:8080",
}
c, err := client.NewClient(config)
if err != nil {
fmt.Printf("Error occurred %v", err)
return
}
metaGetter := c.Misc().MetaGetter()
meta, err := metaGetter.Do(context.Background())
if err != nil {
fmt.Printf("Error occurred %v", err)
return
}
fmt.Printf("Weaviate meta information\n")
fmt.Printf("hostname: %s version: %s\n", meta.Hostname, meta.Version)
fmt.Printf("enabled modules: %+v\n", meta.Modules)
}