scene
This commit is contained in:
20
Server/scene/app/db.go
Normal file
20
Server/scene/app/db.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"common/db/etcd"
|
||||
"scene/config"
|
||||
)
|
||||
|
||||
func (p *Program) initDB(cfg *config.Config) error {
|
||||
// ETCD
|
||||
if err := etcd.Init(cfg.DB.Etcd.Address); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *Program) stopDB() error {
|
||||
_ = etcd.Close()
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user