func (v *BlackholeConfig) Build() (*serial.TypedMessage, error) { config := new(blackhole.Config) if v.Response != nil { response, _, err := configLoader.Load(v.Response) if err != nil { return nil, errors.Base(err).Message("Blackhole: Failed to parse response config.") } responseSettings, err := response.(Buildable).Build() if err != nil { return nil, err } config.Response = responseSettings } return serial.ToTypedMessage(config), nil }
func (this *BlackholeConfig) Build() (*loader.TypedSettings, error) { config := new(blackhole.Config) if this.Response != nil { response, _, err := configLoader.Load(this.Response) if err != nil { return nil, errors.New("Blackhole: Failed to parse response config: " + err.Error()) } responseSettings, err := response.(Buildable).Build() if err != nil { return nil, err } config.Response = responseSettings } return loader.NewTypedSettings(config), nil }