32 lines
651 B
Go
32 lines
651 B
Go
package battletest
|
|
|
|
import (
|
|
"go_dreamfactory/lego/utils/mapstructure"
|
|
"go_dreamfactory/modules"
|
|
)
|
|
|
|
type (
|
|
Options struct {
|
|
modules.Options
|
|
ClientNum int32
|
|
OpenCheck bool
|
|
BattleServerAddr string
|
|
OutFilePath string
|
|
MongodbUrl string
|
|
MongodbDatabase string
|
|
BattleReportId string //战报id
|
|
Workers int32 //并发数
|
|
TestNum int32 //测试次数
|
|
}
|
|
)
|
|
|
|
func (this *Options) LoadConfig(settings map[string]interface{}) (err error) {
|
|
if settings != nil {
|
|
if err = this.Options.LoadConfig(settings); err != nil {
|
|
return
|
|
}
|
|
err = mapstructure.Decode(settings, this)
|
|
}
|
|
return
|
|
}
|