// FanConfig returns the current fan configuration.
504464
func (f *Facade) FanConfig() (network.FanConfig, error) {
	var result params.FanConfigResult
	err := f.caller.FacadeCall("FanConfig", nil, &result)
	if err != nil {
		return nil, err
	}
	return networkingcommon.FanConfigResultToFanConfig(result)
}
474831
func (f *Facade) WatchForFanConfigChanges() (watcher.NotifyWatcher, error) {
	var result params.NotifyWatchResult
	err := f.caller.FacadeCall("WatchForFanConfigChanges", nil, &result)
	if err != nil {
		return nil, err
	}
	return apiwatcher.NewNotifyWatcher(f.caller.RawAPICaller(), result), nil
}
463184
func (c *Config) SSHConfig() *ssh.ServerConfig {

	// Create server config
	sshConfig := &ssh.ServerConfig{
		NoClientAuth:      false,
		PasswordCallback:  c.PasswordCallback,
		PublicKeyCallback: c.PublicKeyCallback,
		AuthLogCallback:   c.AuthLogCallback,
	}
	sshConfig.AddHostKey(c.PrivateKey)
	return sshConfig
}
830828
func (e *Environ) Config() *config.Config {
	e.ecfgMutex.Lock()
	defer e.ecfgMutex.Unlock()
	if e.ecfgObj == nil {
		return nil
	}
	return e.ecfgObj.Config
}
1049662
func OptSetConfig(cfg *Config) PluginControlOpt {
	return func(c *pluginControl) {
		c.Config = cfg
		c.pluginManager.SetPluginConfig(cfg.Plugins)
		c.pluginManager.SetPluginLoadTimeout(c.Config.PluginLoadTimeout)
		c.pluginRunner.SetPluginLoadTimeout(c.Config.PluginLoadTimeout)
	}
}
687512
func (api *DiskAPI) Config(id int64, disk *sacloud.DiskEditValue) (bool, error) {
	var (
		method = "PUT"
		uri    = fmt.Sprintf("%s/%d/config", api.getResourceURL(), id)
	)

	return api.modify(method, uri, disk)
}
501284
func NewConfig(consumerKey, consumerSecret string) *Config {
	return &Config{
		ConsumerKey:    consumerKey,
		ConsumerSecret: consumerSecret,
	}
}
212207
func ParseFanConfig(line string) (config FanConfig, err error) {
	if line == "" {
		return nil, nil
	}
	entries := strings.Split(line, " ")
	config = make([]FanConfigEntry, len(entries))
	for i, line := range entries {
		cidrs := strings.Split(line, "=")
		if len(cidrs) != 2 {
			return nil, fmt.Errorf("invalid FAN config entry: %v", line)
		}
		if _, config[i].Underlay, err = net.ParseCIDR(strings.TrimSpace(cidrs[0])); err != nil {
			return nil, errors.Annotatef(err, "invalid address in FAN config")
		}
		if _, config[i].Overlay, err = net.ParseCIDR(strings.TrimSpace(cidrs[1])); err != nil {
			return nil, errors.Annotatef(err, "invalid address in FAN config")
		}
		underlaySize, _ := config[i].Underlay.Mask.Size()
		overlaySize, _ := config[i].Overlay.Mask.Size()
		if underlaySize <= overlaySize {
			return nil, fmt.Errorf("invalid FAN config, underlay mask must be larger than overlay: %s", line)
		}
	}
	return config, nil
}
410744
func (k *kubernetesClient) SetConfig(cfg *config.Config) error {
	k.lock.Lock()
	defer k.lock.Unlock()
	newCfg, err := providerInstance.newConfig(cfg)
	if err != nil {
		return errors.Trace(err)
	}
	k.envCfgUnlocked = newCfg.Config
	return nil
}
357061
func (j JujuConfigProvider) Config() (ociCommon.ConfigurationProvider, error) {
	if err := j.Validate(); err != nil {
		return nil, err
	}
	return &j, nil
}
397692
func NewConfig(log logging.Logger) *Config {

	cfg := &Config{
		Logger:       log,
		Config:       cluster.NewConfig(),
		Partition:    -1,
		Partitioner:  sarama.NewHashPartitioner,
		RequiredAcks: AcksUnset,
	}

	return cfg
}
1063634
func (c ConfigMap) Config(name string) (string, bool) {
	val, ok := c[name]
	return val, ok
}
1130619
func (g *Generation) Config() map[string]settings.ItemChanges {
	changes := make(map[string]settings.ItemChanges, len(g.doc.Config))
	for appName, appCfg := range g.doc.Config {
		appChanges := make(settings.ItemChanges, len(appCfg))
		for i, ch := range appCfg {
			appChanges[i] = ch.coreChange()
		}
		sort.Sort(appChanges)
		changes[appName] = appChanges
	}
	return changes
}
290985
func (c *Cluster) CreateConfig(s types.ConfigSpec) (string, error) {
	var resp *swarmapi.CreateConfigResponse
	if err := c.lockedManagerAction(func(ctx context.Context, state nodeState) error {
		configSpec := convert.ConfigSpecToGRPC(s)

		r, err := state.controlClient.CreateConfig(ctx,
			&swarmapi.CreateConfigRequest{Spec: &configSpec})
		if err != nil {
			return err
		}
		resp = r
		return nil
	}); err != nil {
		return "", err
	}
	return resp.Config.ID, nil
}
928735
func (r *Runtime) SetConfig(g *generate.Generator) error {
	if g == nil {
		return errors.New("cannot set a nil config")
	}
	return g.SaveToFile(filepath.Join(r.bundleDir(), "config.json"), generate.ExportOptions{})
}
998084
func (c *Pre182) Config() *Config {
	cfg := &Config{
		Root:   c.Root.StoreConfig(),
		Mounts: make(map[string]*StoreConfig, len(c.Mounts)),
	}
	for k, v := range c.Mounts {
		cfg.Mounts[k] = v.StoreConfig()
	}
	return cfg
}
381857
func NewConfig(rootLogger *logrus.Logger, cfgfile string) Config {
	logger := rootLogger.WithFields(logrus.Fields{"prefix": "config"})

	viper.SetConfigFile(cfgfile)
	input, err := ioutil.ReadFile(cfgfile)
	if err != nil {
		logger.Fatalf("Failed to read configuration file: %#v", err)
	}

	mycfg := newConfigFromString(logger, input)
	if mycfg.cv.General.MediaDownloadSize == 0 {
		mycfg.cv.General.MediaDownloadSize = 1000000
	}
	viper.WatchConfig()
	viper.OnConfigChange(func(e fsnotify.Event) {
		logger.Println("Config file changed:", e.Name)
	})
	return mycfg
}