milvus-logo
Star
0
Forks
0
快速开始

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())
}