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.
31 lines
741 B
31 lines
741 B
package agents
|
|
|
|
import (
|
|
"yunyan/modules"
|
|
|
|
"yunyan/lego/utils/mapstructure"
|
|
)
|
|
|
|
type (
|
|
IOptions interface {
|
|
modules.IOptions
|
|
}
|
|
Options struct {
|
|
modules.Options
|
|
AgentServerAddr string `json:"agent_server_addr" mapstructure:"agent_server_addr"` //代理服务器地址
|
|
AppID string `json:"app_id" mapstructure:"app_id"` //应用ID
|
|
AppSecret string `json:"app_secret" mapstructure:"app_secret"` //应用密钥
|
|
}
|
|
)
|
|
|
|
func (this *Options) LoadConfig(settings map[string]interface{}) (err error) {
|
|
if settings != nil {
|
|
if err = this.Options.LoadConfig(settings); err != nil {
|
|
return
|
|
}
|
|
if err = mapstructure.Decode(settings, this); err != nil {
|
|
return
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|