milvus/core/src/dog_segment/collection_c.cpp
bigsheeper bb9c906ef6 Use go mod instead of GO_PATH and add more cgo interfeces
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
2020-09-01 16:23:39 +08:00

24 lines
664 B
C++

#include "collection_c.h"
#include "Collection.h"
CCollection
NewCollection(const char* collection_name, const char* schema_conf) {
auto name = std::string(collection_name);
auto conf = std::string(schema_conf);
auto collection = std::make_unique<milvus::dog_segment::Collection>(name, conf);
// TODO: delete print
std::cout << "create collection " << collection_name << std::endl;
return (void*)collection.release();
}
void
DeleteCollection(CCollection collection) {
auto col = (milvus::dog_segment::Collection*)collection;
// TODO: delete print
std::cout << "delete collection " << col->get_collection_name() << std::endl;
delete col;
}