Browse Source

rename URL to Target

pull/72/head v1.6.1
yedf2 4 years ago
parent
commit
90d8f6e0df
  1. 4
      common/types.go
  2. 6
      conf.sample.yml
  3. 2
      dtmsvr/dtmsvr.go

4
common/types.go

@ -26,7 +26,7 @@ const (
// MicroService config type for micro service // MicroService config type for micro service
type MicroService struct { type MicroService struct {
Driver string `yaml:"Driver"` Driver string `yaml:"Driver"`
URL string `yaml:"URL"` Target string `yaml:"Target"`
EndPoint string `yaml:"EndPoint"` EndPoint string `yaml:"EndPoint"`
} }
@ -62,7 +62,7 @@ func MustLoadConfig() {
"conn_max_life_time": dtmimp.OrString(os.Getenv("DB_CONN_MAX_LIFE_TIME"), "5"), "conn_max_life_time": dtmimp.OrString(os.Getenv("DB_CONN_MAX_LIFE_TIME"), "5"),
} }
DtmConfig.MicroService.Driver = dtmimp.OrString(os.Getenv("MICRO_SERVICE_DRIVER"), "default") DtmConfig.MicroService.Driver = dtmimp.OrString(os.Getenv("MICRO_SERVICE_DRIVER"), "default")
DtmConfig.MicroService.URL = os.Getenv("MICRO_SERVICE_URL") DtmConfig.MicroService.Target = os.Getenv("MICRO_SERVICE_TARGET")
DtmConfig.MicroService.EndPoint = os.Getenv("MICRO_SERVICE_ENDPOINT") DtmConfig.MicroService.EndPoint = os.Getenv("MICRO_SERVICE_ENDPOINT")
DtmConfig.DisableLocalhost = getIntEnv("DISABLE_LOCALHOST", "0") DtmConfig.DisableLocalhost = getIntEnv("DISABLE_LOCALHOST", "0")
DtmConfig.UpdateBranchSync = getIntEnv("UPDATE_BRANCH_SYNC", "0") DtmConfig.UpdateBranchSync = getIntEnv("UPDATE_BRANCH_SYNC", "0")

6
conf.sample.yml

@ -16,8 +16,12 @@ DB:
# conn_max_life_time: 'dbconnmaxlifetime' # conn_max_life_time: 'dbconnmaxlifetime'
# MicroService: # MicroService:
# Driver: 'dtm-driver-gozero' # name of the driver to handle register/discover # Driver: 'dtm-driver-gozero' # name of the driver to handle register/discover
# URL: 'etcd://localhost:2379/dtmservice' # register dtm server to this url # Target: 'etcd://localhost:2379/dtmservice' # register dtm server to this url
# EndPoint: 'localhost:36790' # EndPoint: 'localhost:36790'
# MicroService:
# Driver: 'dtm-driver-protocol1'
# the unit of following configurations is second # the unit of following configurations is second
# TransCronInterval: 3 # the interval to poll unfinished global transaction for every dtm process # TransCronInterval: 3 # the interval to poll unfinished global transaction for every dtm process

2
dtmsvr/dtmsvr.go

@ -54,7 +54,7 @@ func StartSvr() {
time.Sleep(100 * time.Millisecond) time.Sleep(100 * time.Millisecond)
err = dtmdriver.Use(config.MicroService.Driver) err = dtmdriver.Use(config.MicroService.Driver)
dtmimp.FatalIfError(err) dtmimp.FatalIfError(err)
err = dtmdriver.GetDriver().RegisterGrpcService(config.MicroService.URL, config.MicroService.EndPoint) err = dtmdriver.GetDriver().RegisterGrpcService(config.MicroService.Target, config.MicroService.EndPoint)
dtmimp.FatalIfError(err) dtmimp.FatalIfError(err)
} }

Loading…
Cancel
Save