become-nice b8f012d8f0 Add interface of writenode
Signed-off-by: become-nice <995581097@qq.com>
2020-08-24 11:58:51 +08:00

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)
}
}