milvus/tests/go_client/testcases/helper/collection_helper.go
ThreadDao c1b4bae130
test: add go-sdk cases for collection related APIs (#39537)
issue: 33419
- add cases for: RenameCollection, CollectionProperties,
GetCollectionStats, fast collection

---------

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2025-02-11 13:54:45 +08:00

38 lines
871 B
Go

package helper
import (
"github.com/milvus-io/milvus/client/v2/entity"
)
type CreateCollectionParams struct {
CollectionFieldsType CollectionFieldsType // collection fields type
}
func NewCreateCollectionParams(collectionFieldsType CollectionFieldsType) *CreateCollectionParams {
return &CreateCollectionParams{
CollectionFieldsType: collectionFieldsType,
}
}
type CreateCollectionOpt func(opt *createCollectionOpt)
type createCollectionOpt struct {
shardNum int32
enabledDynamicSchema bool
consistencyLevel entity.ConsistencyLevel
properties map[string]any
}
func TWithShardNum(shardNum int32) CreateCollectionOpt {
return func(opt *createCollectionOpt) {
opt.shardNum = shardNum
}
}
func TWithProperties(properties map[string]any) CreateCollectionOpt {
return func(opt *createCollectionOpt) {
opt.properties = properties
}
}