예제 #1
0
func (this *DokodemoConfig) Build() (*loader.TypedSettings, error) {
	config := new(dokodemo.Config)
	if this.Host != nil {
		config.Address = this.Host.Build()
	}
	config.Port = uint32(this.PortValue)
	config.NetworkList = this.NetworkList.Build()
	config.Timeout = this.TimeoutValue
	config.FollowRedirect = this.Redirect
	return loader.NewTypedSettings(config), nil
}
예제 #2
0
func (v *DokodemoConfig) Build() (*serial.TypedMessage, error) {
	config := new(dokodemo.Config)
	if v.Host != nil {
		config.Address = v.Host.Build()
	}
	config.Port = uint32(v.PortValue)
	config.NetworkList = v.NetworkList.Build()
	config.Timeout = v.TimeoutValue
	config.FollowRedirect = v.Redirect
	return serial.ToTypedMessage(config), nil
}