21 lines
276 B
Go
21 lines
276 B
Go
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
|
|
}
|