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 }