mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-30 23:45:28 +08:00
32 lines
489 B
Go
32 lines
489 B
Go
package conf
|
|
|
|
import (
|
|
"fmt"
|
|
"path"
|
|
"os"
|
|
"github.com/BurntSushi/toml"
|
|
)
|
|
|
|
type StorageConfig struct {
|
|
Driver string
|
|
}
|
|
|
|
var config *StorageConfig = new(StorageConfig)
|
|
|
|
func GetConfig() *StorageConfig {
|
|
return config
|
|
}
|
|
|
|
func init() {
|
|
//读取配置文件
|
|
dirPath, _ := os.Getwd()
|
|
filePath := path.Join(dirPath, "config/storage.toml")
|
|
fmt.Println("aaa")
|
|
fmt.Println(filePath)
|
|
fmt.Println("bbb")
|
|
_, err := toml.DecodeFile(filePath, config)
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
}
|