weaviate-go-client

module
v4.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2024 License: BSD-3-Clause

README

Weaviate go client Weaviate logo

A go native client for weaviate.

Usage

In order to get the go client v4 issue this command:

$ go get github.com/weaviate/weaviate-go-client/v4@v4.x.x

where v4.x.x is the desired go client v4 version, for example v4.14.0

Add dependency to your go.mod:

require github.com/weaviate/weaviate-go-client/v4 v4.14.0

Connect to Weaviate on localhost:8080 and fetch meta information

package main

import (
  "context"
  "fmt"

  client "github.com/weaviate/weaviate-go-client/v4/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)
}

Documentation

Support

Contributing

Build Status

Build Status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL