forked from milvus-io/milvus-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
- Loading branch information
Showing
3 changed files
with
184 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
package testcases | ||
|
||
import ( | ||
"github.com/milvus-io/milvus-sdk-go/v2/client" | ||
"github.com/milvus-io/milvus-sdk-go/v2/entity" | ||
) | ||
|
||
type HelpPartitionColumns struct { | ||
PartitionName string | ||
IdsColumn entity.Column | ||
VectorColumn entity.Column | ||
} | ||
|
||
type CollectionFieldsType string | ||
|
||
type CollectionParams struct { | ||
CollectionFieldsType CollectionFieldsType // collection fields type | ||
AutoID bool // autoId | ||
EnableDynamicField bool // enable dynamic field | ||
ShardsNum int32 | ||
Fields []*entity.Field | ||
Dim int64 | ||
MaxLength int64 | ||
} | ||
|
||
type DataParams struct { | ||
CollectionName string // insert data into which collection | ||
PartitionName string | ||
CollectionFieldsType CollectionFieldsType // collection fields type | ||
start int // start | ||
nb int // insert how many data | ||
dim int64 | ||
EnableDynamicField bool // whether insert dynamic field data | ||
WithRows bool | ||
Data []entity.Column | ||
Rows []interface{} | ||
DoInsert bool | ||
} | ||
|
||
type FlushParams struct { | ||
DoFlush bool | ||
PartitionNames []string | ||
async bool | ||
} | ||
|
||
type IndexParams struct { | ||
DoIndex bool | ||
Index entity.Index | ||
FieldName string | ||
async bool | ||
IndexOption client.IndexOption | ||
} | ||
|
||
type LoadParams struct { | ||
DoLoad bool | ||
PartitionNames []string | ||
async bool | ||
LoadOption client.LoadCollectionOption | ||
} | ||
|
||
type ClientParamsOption struct { | ||
DataParams DataParams | ||
FlushParams FlushParams | ||
IndexParams IndexParams | ||
LoadParams LoadParams | ||
} | ||
|
||
type PrepareCollectionOption func(opt *ClientParamsOption) | ||
|
||
|
||
func WithDataParams(dp DataParams) PrepareCollectionOption { | ||
return func(opt *ClientParamsOption) { | ||
opt.DataParams = dp | ||
} | ||
} | ||
|
||
func WithFlushParams(fp FlushParams) PrepareCollectionOption { | ||
return func(opt *ClientParamsOption) { | ||
opt.FlushParams = fp | ||
} | ||
} | ||
|
||
func WithIndexParams(ip IndexParams) PrepareCollectionOption { | ||
return func(opt *ClientParamsOption) { | ||
opt.IndexParams = ip | ||
} | ||
} | ||
|
||
func WithLoadParams(lp LoadParams) PrepareCollectionOption { | ||
return func(opt *ClientParamsOption) { | ||
opt.LoadParams = lp | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters