milvus-logo
LFAI
< Docs
  • Go
    • Connections

NewGrpcClient()

This is the constructor method set (only one for current release) to obtain a Client instance.

Invocation

client.NewGrpcClient(ctx, addr)

Parameters

ParameterDescriptionType
ctxContext to control API invocation processcontext.Context
addrAddress of the Milvus instanceString

Return

A Milvus client instance.

Errors

Connection error (if any).

Example

milvusClient, err := client.NewGrpcClient(
    context.Background(), 
    "localhost:19530"
)
if err != nil {
  log.Fatal("failed to connect to Milvus:", err.Error())
}

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?