github.com/milvus-io/milvus-sdk-go/v2@v2.4.1/entity/collection.go (about) 1 // Copyright (C) 2019-2021 Zilliz. All rights reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance 4 // with the License. You may obtain a copy of the License at 5 // 6 // http://www.apache.org/licenses/LICENSE-2.0 7 // 8 // Unless required by applicable law or agreed to in writing, software distributed under the License 9 // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 10 // or implied. See the License for the specific language governing permissions and limitations under the License. 11 12 // Package entity defines entities used in sdk 13 package entity 14 15 // DefaultShardNumber const value for using Milvus default shard number. 16 const DefaultShardNumber int32 = 0 17 18 // DefaultConsistencyLevel const value for using Milvus default consistency level setting. 19 const DefaultConsistencyLevel ConsistencyLevel = ClBounded 20 21 // Collection represent collection meta in Milvus 22 type Collection struct { 23 ID int64 // collection id 24 Name string // collection name 25 Schema *Schema // collection schema, with fields schema and primary key definition 26 PhysicalChannels []string 27 VirtualChannels []string 28 Loaded bool 29 ConsistencyLevel ConsistencyLevel 30 ShardNum int32 31 Properties map[string]string 32 } 33 34 // Partition represent partition meta in Milvus 35 type Partition struct { 36 ID int64 // partition id 37 Name string // partition name 38 Loaded bool // partition loaded 39 } 40 41 // ReplicaGroup represents a replica group 42 type ReplicaGroup struct { 43 ReplicaID int64 44 NodeIDs []int64 45 ShardReplicas []*ShardReplica 46 } 47 48 // ShardReplica represents a shard in the ReplicaGroup 49 type ShardReplica struct { 50 LeaderID int64 51 NodesIDs []int64 52 DmChannelName string 53 }