milvusgo

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 6 Imported by: 4

README

Unofficial Milvus Go SDK

GoDoc Go Report Card GitHub release

This is Milvus's unofficial Go client, designed to enable you to use Milvus's services easily from your own applications.

Milvus

Milvus is a vector database that allows you to build high-performance vector search applications.

API support

collections
  • ✅ list
  • ✅ create
  • ✅ describe
  • ✅ update
  • ✅ drop
vectors
  • ✅ get
  • ✅ insert
  • ✅ delete
  • ✅ query
  • ✅ search

Getting started

Installation

You can load milvus-go into your project by using:

go get github.com/henomis/milvus-go
Run Milvus

You can run Milvus using Docker:

cd docker && docker-compose up -d

Please refer to the official documentation for more information about Milvus.

Configuration

The only thing you need to start using Milvus's is username and password. Copy and paste it in the corresponding place in the code, select the API and the parameters you want to use, and that's it.

Usage

Please refer to the examples folder to see how to use the SDK.

Here below a simple usage example:

package main

import (
	"context"
	"fmt"

	milvusgo "github.com/henomis/milvus-go"
	"github.com/henomis/milvus-go/request"
	"github.com/henomis/milvus-go/response"
)

func main() {

	client := milvusgo.New("http://localhost:19530", "root", "Milvus")

	resp := &response.VectorSearch{}
	err := client.VectorSearch(
		context.Background(),
		&request.VectorSearch{
			CollectionName: "test",
			Vector:         []float64{0.1, 0.2, 0.3, 0.4},
		},
		resp,
	)
	if err != nil {
		panic(err)
	}

	fmt.Printf("resp: %#v\n", resp)

}

Who uses milvus-go?

  • LinGoose Go framework for building awesome LLM apps

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(endpoint, username, password string) *Client

func (*Client) CollectionCreate

func (c *Client) CollectionCreate(
	ctx context.Context,
	req *request.CollectionCreate,
	res *response.CollectionCreate,
) error

func (*Client) CollectionDescribe

func (c *Client) CollectionDescribe(
	ctx context.Context,
	req *request.CollectionDescribe,
	res *response.CollectionDescribe,
) error

func (*Client) CollectionDrop

func (c *Client) CollectionDrop(
	ctx context.Context,
	req *request.CollectionDrop,
	res *response.CollectionDrop,
) error

func (*Client) CollectionList

func (c *Client) CollectionList(
	ctx context.Context,
	req *request.CollectionList,
	res *response.CollectionList,
) error

func (*Client) VectorDelete

func (c *Client) VectorDelete(
	ctx context.Context,
	req *request.VectorDelete,
	res *response.VectorDelete,
) error

func (*Client) VectorGet

func (c *Client) VectorGet(
	ctx context.Context,
	req *request.VectorGet,
	res *response.VectorGet,
) error

func (*Client) VectorInsert

func (c *Client) VectorInsert(
	ctx context.Context,
	req *request.VectorInsert,
	res *response.VectorInsert,
) error

func (*Client) VectorQuery

func (c *Client) VectorQuery(
	ctx context.Context,
	req *request.VectorQuery,
	res *response.VectorQuery,
) error

func (*Client) VectorSearch

func (c *Client) VectorSearch(
	ctx context.Context,
	req *request.VectorSearch,
	res *response.VectorSearch,
) error

Directories

Path Synopsis
examples
cmd/vectorGet command
cmd/vectorQuery command

Jump to

Keyboard shortcuts

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