// fetchConfigs loads proto messages with rules from the config.
12928
func fetchConfigs(c context.Context, f policy.ConfigFetcher) (policy.ConfigBundle, error) {
	cfg := &admin.ServiceAccountsPermissions{}
	if err := f.FetchTextProto(c, serviceAccountsCfg, cfg); err != nil {
		return nil, err
	}
	return policy.ConfigBundle{serviceAccountsCfg: cfg}, nil
}
213584
func (xc *CommonExchange) fetch(request *http.Request, response interface{}) (err error) {
	resp, err := xc.client.Do(request)
	if err != nil {
		return fmt.Errorf(fmt.Sprintf("Request failed: %v", err))
	}
	defer resp.Body.Close()
	err = json.NewDecoder(resp.Body).Decode(response)
	if err != nil {
		return fmt.Errorf(fmt.Sprintf("Failed to decode json from %s: %v", request.URL.String(), err))
	}
	return
}
546864
func (mysqld *Mysqld) fetchVariables(ctx context.Context, pattern string) (map[string]string, error) {
	query := fmt.Sprintf("SHOW VARIABLES LIKE '%s'", pattern)
	qr, err := mysqld.FetchSuperQuery(ctx, query)
	if err != nil {
		return nil, err
	}
	if len(qr.Fields) != 2 {
		return nil, fmt.Errorf("query %#v returned %d columns, expected 2", query, len(qr.Fields))
	}
	varMap := make(map[string]string, len(qr.Rows))
	for _, row := range qr.Rows {
		varMap[row[0].ToString()] = row[1].ToString()
	}
	return varMap, nil
}
1280704
func getConfig(t *testing.T) *cfg.Config {
	c := cfg.ResetTestRoot(t.Name())

	// and we use random ports to run in parallel
	tm, rpc, grpc := makeAddrs()
	c.P2P.ListenAddress = tm
	c.RPC.ListenAddress = rpc
	c.RPC.GRPCListenAddress = grpc
	return c
}
629894
func (c *Config) GetFields() []string {
	var names []string
	for k := range c.fields.dict() {
		names = append(names, k)
	}
	return names
}
1309107
func (s *Service) GetConfigSets() *GetConfigSetsCall {
	c := &GetConfigSetsCall{s: s, urlParams_: make(gensupport.URLParams)}
	return c
}
484015
func (mgr *SettingsManager) GetSettings() (*ArgoCDSettings, error) {
	err := mgr.ensureSynced(false)
	if err != nil {
		return nil, err
	}
	argoCDCM, err := mgr.configmaps.ConfigMaps(mgr.namespace).Get(common.ArgoCDConfigMapName)
	if err != nil {
		return nil, err
	}
	argoCDSecret, err := mgr.secrets.Secrets(mgr.namespace).Get(common.ArgoCDSecretName)
	if err != nil {
		return nil, err
	}
	var settings ArgoCDSettings
	var errs []error
	if err := updateSettingsFromConfigMap(&settings, argoCDCM); err != nil {
		errs = append(errs, err)
	}
	if err := updateSettingsFromSecret(&settings, argoCDSecret); err != nil {
		errs = append(errs, err)
	}
	if len(errs) > 0 {
		return &settings, errs[0]
	}
	return &settings, nil
}
531019
func (confSrc *CommandLineConfigurationSource) GetConfigurations() (map[string]interface{}, error) {
	configMap := make(map[string]interface{})

	confSrc.Lock()
	defer confSrc.Unlock()
	for key, value := range confSrc.Configurations {
		configMap[key] = value
	}

	return configMap, nil
}
797777
func (c *Configs) GetConfig(configName configName) (*ConfigSettings, error) {
	// Order byConfig according to configNames ordering function.
	out := &ConfigSettings{}
	for _, pair := range c.getSortedConfigPairs() {
		ok := true
		for i, confKey := range configName {
			if pair.key[i].isBound() && pair.key[i].compare(confKey) != 0 {
				ok = false
				break
			}
		}
		if ok {
			var err error
			if out, err = out.union(pair.value); err != nil {
				return nil, err
			}
		}
	}
	return out, nil
}
1074743
func LoadConfigFromFile() (cfgs map[string]*Configuration, err error) {
	var b []byte
	cfgs = make(map[string]*Configuration)

	p, err := ConfigFilePath()
	if err != nil {
		return
	}
	if _, err = os.Stat(p); !os.IsNotExist(err) {
		if b, err = ioutil.ReadFile(p); err != nil {
			return
		}

		if err = yaml.Unmarshal(b, &cfgs); err != nil {
			return
		}
	} else {
		return
	}

	return
}
706043
func (o *NSGateway) InfrastructureConfigs(info *bambou.FetchingInfo) (InfrastructureConfigsList, *bambou.Error) {

	var list InfrastructureConfigsList
	err := bambou.CurrentSession().FetchChildren(o, InfrastructureConfigIdentity, &list, info)
	return list, err
}
115397
func (c *Config) GetValues(key string) (v *Values) {
	v, _ = c.GetValuesOk(key)
	return
}
688865
func (m *ChanStatusManager) fetchChannels() ([]*channeldb.OpenChannel, error) {
	allChannels, err := m.cfg.DB.FetchAllOpenChannels()
	if err != nil {
		return nil, err
	}

	// Filter out private channels.
	var channels []*channeldb.OpenChannel
	for _, c := range allChannels {
		// We'll skip any private channels, as they aren't used for
		// routing within the network by other nodes.
		if c.ChannelFlags&lnwire.FFAnnounceChannel == 0 {
			continue
		}

		channels = append(channels, c)
	}

	return channels, nil
}
1033059
func (sdk *FabricSDK) loadConfigs(configProvider core.ConfigProvider) (*configs, error) {
	c := &configs{
		identityConfig:    sdk.opts.IdentityConfig,
		endpointConfig:    sdk.opts.endpointConfig,
		cryptoSuiteConfig: sdk.opts.CryptoSuiteConfig,
		metricsConfig:     sdk.opts.metricsConfig,
	}

	var configBackend []core.ConfigBackend
	var err error

	if configProvider != nil {
		configBackend, err = configProvider()
		if err != nil {
			return nil, errors.WithMessage(err, "unable to load config backend")
		}
	}

	//configs passed through opts take priority over default ones
	// load crypto suite config
	c.cryptoSuiteConfig, err = sdk.loadCryptoConfig(configBackend...)
	if err != nil {
		return nil, errors.WithMessage(err, "unable to load crypto suite config")
	}

	//Initialize cryptosuite once crypto Suite config is available
	err = sdk.initializeCryptoSuite(c.cryptoSuiteConfig)
	if err != nil {
		return nil, errors.WithMessage(err, "unable to initialize cryptosuite using crypto suite config")
	}

	// load endpoint config
	c.endpointConfig, err = sdk.loadEndpointConfig(configBackend...)
	if err != nil {
		return nil, errors.WithMessage(err, "unable to load endpoint config")
	}

	// load identity config
	c.identityConfig, err = sdk.loadIdentityConfig(configBackend...)
	if err != nil {
		return nil, errors.WithMessage(err, "unable to load identity config")
	}

	// load metrics config
	c.metricsConfig, err = sdk.loadMetricsConfig(configBackend...)
	if err != nil {
		return nil, errors.WithMessage(err, "unable to load metrics config")
	}

	sdk.opts.ConfigBackend = configBackend

	return c, nil
}
921862
func (cfgSrcHandler *Handler) GetConfigurations() (map[string]interface{}, error) {
	configMap := make(map[string]interface{})

	err := cfgSrcHandler.refreshConfigurations("")
	if err != nil {
		return nil, err
	}
	if cfgSrcHandler.RefreshMode == 1 {
		go cfgSrcHandler.refreshConfigurationsPeriodically("")
	}

	cfgSrcHandler.Lock()
	for key, value := range cfgSrcHandler.Configurations {
		configMap[key] = value
	}
	cfgSrcHandler.Unlock()
	return configMap, nil
}
314722
func fetchConfigFile(c context.Context, path string) (string, *config.Meta, error) {
	configSet := cfgclient.CurrentServiceConfigSet(c)
	logging.Infof(c, "Reading %q from config set %q", path, configSet)
	c, cancelFunc := context.WithTimeout(c, 29*time.Second) // URL fetch deadline
	defer cancelFunc()

	var (
		content string
		meta    config.Meta
	)
	if err := cfgclient.Get(c, cfgclient.AsService, configSet, path, cfgclient.String(&content), &meta); err != nil {
		return "", nil, err
	}
	return content, &meta, nil
}
171507
func (e *NestedLoopApplyExec) fetchAllInners(ctx context.Context) error {
	err := e.innerExec.Open(ctx)
	defer terror.Call(e.innerExec.Close)
	if err != nil {
		return err
	}
	e.innerList.Reset()
	innerIter := chunk.NewIterator4Chunk(e.innerChunk)
	for {
		err := e.innerExec.Next(ctx, chunk.NewRecordBatch(e.innerChunk))
		if err != nil {
			return err
		}
		if e.innerChunk.NumRows() == 0 {
			return nil
		}

		e.innerSelected, err = expression.VectorizedFilter(e.ctx, e.innerFilter, innerIter, e.innerSelected)
		if err != nil {
			return err
		}
		for row := innerIter.Begin(); row != innerIter.End(); row = innerIter.Next() {
			if e.innerSelected[row.Idx()] {
				e.innerList.AppendRow(row)
			}
		}
	}
}