// SetupConfig provides a configuration to implmentations. Every implmentation
// can have its own config type.
423179
func (l *LinuxMonitor) SetupConfig(registerer registerer.Registerer, cfg interface{}) error {

	if cfg == nil {
		cfg = DefaultConfig(false, false)
	}

	linuxConfig, ok := cfg.(*Config)
	if !ok {
		return fmt.Errorf("Invalid configuration specified")
	}

	if registerer != nil {
		if linuxConfig.SSH {
			if err := registerer.RegisterProcessor(common.SSHSessionPU, l.proc); err != nil {
				return err
			}
		} else {
			if err := registerer.RegisterProcessor(common.HostNetworkPU, l.proc); err != nil {
				return err
			}
			if err := registerer.RegisterProcessor(common.HostPU, l.proc); err != nil {
				return err
			}
			if err := registerer.RegisterProcessor(common.LinuxProcessPU, l.proc); err != nil {
				return err
			}
		}
	}

	// Setup defaults
	linuxConfig = SetupDefaultConfig(linuxConfig)

	// Setup config
	l.proc.host = linuxConfig.Host
	l.proc.ssh = linuxConfig.SSH
	l.proc.netcls = cgnetcls.NewCgroupNetController(common.TriremeCgroupPath, linuxConfig.ReleasePath)

	l.proc.regStart = regexp.MustCompile("^[a-zA-Z0-9_]{1,11}$")
	l.proc.regStop = regexp.MustCompile("^/trireme/[a-zA-Z0-9_]{1,11}$")

	l.proc.metadataExtractor = linuxConfig.EventMetadataExtractor
	if l.proc.metadataExtractor == nil {
		return fmt.Errorf("Unable to setup a metadata extractor")
	}

	return nil
}
394723
func (s *ParallelismConfiguration) SetConfigurationType(v string) *ParallelismConfiguration {
	s.ConfigurationType = &v
	return s
}
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
}
1336478
func (db *DB) SetConfig(config Config) error {
	db.mu.Lock()
	defer db.mu.Unlock()
	if db.closed {
		return ErrDatabaseClosed
	}
	switch config.SyncPolicy {
	default:
		return ErrInvalidSyncPolicy
	case Never, EverySecond, Always:
	}
	db.config = config
	return nil
}
647148
func (p *Project) AddConfig(name string, config *config.ServiceConfig) error {
	p.Notify(events.ServiceAdd, name, nil)

	p.ServiceConfigs.Add(name, config)
	p.reload = append(p.reload, name)

	return nil
}
1310091
func (s *CreateCompilationJobInput) SetInputConfig(v *InputConfig) *CreateCompilationJobInput {
	s.InputConfig = v
	return s
}
240123
func (s *ParallelismConfigurationDescription) SetConfigurationType(v string) *ParallelismConfigurationDescription {
	s.ConfigurationType = &v
	return s
}
840107
func Setup(c config.Config) error {
	disableADR = c.NetworkServer.NetworkSettings.DisableADR
	installationMargin = c.NetworkServer.NetworkSettings.InstallationMargin

	return nil
}
1094357
func (s *RegisterCACertificateInput) SetRegistrationConfig(v *RegistrationConfig) *RegisterCACertificateInput {
	s.RegistrationConfig = v
	return s
}
955225
func (c *Configs) setConfig(confName configName, value *ConfigSettings) {
	assert(len(confName) == len(c.ConfigVariables))
	assert(value != nil)
	key := confName.key()
	pair, ok := c.byConfig[key]
	assert(!ok, "setConfig must not override existing keys (%s => %v)", key, pair.value)
	c.byConfig[key] = configPair{confName, value}
}
366884
func (c *CniMonitor) SetupConfig(registerer registerer.Registerer, cfg interface{}) error {

	defaultConfig := DefaultConfig()
	if cfg == nil {
		cfg = defaultConfig
	}

	cniConfig, ok := cfg.(*Config)
	if !ok {
		return fmt.Errorf("Invalid configuration specified")
	}

	if registerer != nil {
		if err := registerer.RegisterProcessor(common.KubernetesPU, c.proc); err != nil {
			return err
		}
	}

	// Setup defaults
	cniConfig = SetupDefaultConfig(cniConfig)

	// Setup configuration
	c.proc.metadataExtractor = cniConfig.EventMetadataExtractor
	if c.proc.metadataExtractor == nil {
		return fmt.Errorf("Unable to setup a metadata extractor")
	}

	return nil
}
764593
func (c *Client) Config() Config {
	c.mu.Lock()
	defer c.mu.Unlock()
	return c.cfg
}
415881
func (s *GetFunctionOutput) SetConfiguration(v *FunctionConfiguration) *GetFunctionOutput {
	s.Configuration = v
	return s
}
39599
func (s *CreateCrawlerInput) SetConfiguration(v string) *CreateCrawlerInput {
	s.Configuration = &v
	return s
}
70621
func (s *ListConfigurationsInput) SetConfigurationType(v string) *ListConfigurationsInput {
	s.ConfigurationType = &v
	return s
}
1118271
func (b *Backend) Setup(ctx context.Context, config *logical.BackendConfig) error {
	b.logger = config.Logger
	b.system = config.System
	return nil
}
952606
func (c *Config) AddConfig(section string, option string, value string) bool {
	if section == "" {
		section = DEFAULT_SECTION
	}

	if _, ok := c.data[section]; !ok {
		c.data[section] = make(map[string]string)
	}

	_, ok := c.data[section][option]
	c.data[section][option] = value

	return !ok
}