🔥A cross-language distributed transaction manager. Support xa, tcc, saga, transactional messages. 跨语言分布式事务管理器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
552 B

package dtmsvr
import (
"path/filepath"
"runtime"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
)
type Config struct {
Server string `json:"server"`
Rabbitmq RabbitmqConfig `json:"rabbitmq"`
}
var ServerConfig Config = Config{}
func LoadConfig() {
_, file, _, _ := runtime.Caller(0)
viper.SetConfigFile(filepath.Dir(file) + "/dtmsvr.yml")
if err := viper.ReadInConfig(); err != nil {
panic(err)
}
if err := viper.Unmarshal(&ServerConfig); err != nil {
panic(err)
}
logrus.Printf("config is: %v", ServerConfig)
}