func (reader PluginConfigReaderWithError) GetURL(key string, defaultValue string) (*url.URL, error) {
	value, err := reader.GetString(key, defaultValue)
	if err != nil {
		return nil, err
	}
	if value == "" {
		return nil, nil
	}
	urlValue, err := url.Parse(value)
	if err != nil {
		return nil, err
	}
	return urlValue, nil
}
GetURL tries to read an URL struct from a PluginConfig.
If that value is not found nil is returned.
package core
import (
	"fmt"
	"github.com/sirupsen/logrus"
	"github.com/trivago/tgo"
	"github.com/trivago/tgo/tcontainer"
	"github.com/trivago/tgo/tstrings"
	"net/url"
)
type PluginConfigReaderWithError struct {
	config *PluginConfig
}
func NewPluginConfigReaderWithError(config *PluginConfig) PluginConfigReaderWithError {
	return PluginConfigReaderWithError{
		config: config,
	}
}
func (reader PluginConfigReaderWithError) GetLogger() logrus.FieldLogger {
	return logrus.WithFields(logrus.Fields{
		"PluginType": reader.config.Typename,
		"PluginID":   reader.config.ID,
	})
}
func (reader PluginConfigReaderWithError) GetSubLogger(subScope string) logrus.FieldLogger {
	return reader.GetLogger().WithField("Scope", subScope)
}
func (reader PluginConfigReaderWithError) GetID() string {
	return reader.config.ID
}
func (reader PluginConfigReaderWithError) GetTypename() string {
	return reader.config.Typename
}
func (reader PluginConfigReaderWithError) HasValue(key string) bool {
	key = reader.config.registerKey(key)
	_, exists := reader.config.Settings.Value(key)
	return exists
}
func (reader PluginConfigReaderWithError) GetString(key string, defaultValue string) (string, error) {
	key = reader.config.registerKey(key)
	if reader.HasValue(key) {
		value, err := reader.config.Settings.String(key)
		return tstrings.Unescape(value), err
	}
	return defaultValue, nil
}