// Config returns a file pointer for read to the config file
427968
func (d *DotGit) Config() (billy.File, error) {
	return d.fs.Open(configPath)
}
60126
func LoadConfig(path string, logger log.Logger) (*Config, error) {
	fi, err := os.Stat(path)
	if err != nil {
		return nil, err
	}

	if fi.IsDir() {
		return LoadConfigDir(path, logger)
	}
	return LoadConfigFile(path, logger)
}
742900
func (c *ConfigStorage) SetConfig(cfg *config.Config) error {
	if err := c.temporal.SetConfig(cfg); err != nil {
		return err
	}

	c.set = true
	return nil
}
391199
func (mr *ModRunner) ReadConfig() error {
	ret, err := ioutil.ReadFile(mr.ConfPath)
	if err != nil {
		return fmt.Errorf("Error reading config file %s: %s", mr.ConfPath, err)
	}
	newcnf, err := conf.Parse(mr.ConfPath, string(ret))
	if err != nil {
		return fmt.Errorf("Error reading config file %s: %s", mr.ConfPath, err)
	}

	if _, err := shell.GetShellName(newcnf.GetVariables()[shellVarName]); err != nil {
		return err
	}

	newcnf.CommonExcludes(CommonExcludes)
	mr.Config = newcnf
	return nil
}
1276805
func (c *Context) Config() string {
	f := c.cmd.Flags.Lookup("config")
	if f != nil {
		return f.Value.String()
	}
	return ""
}
662763
func ConfigAt(repoPath string) (*config.Config, error) {

	// packageLock must be held to ensure that the Read is atomic.
	packageLock.Lock()
	defer packageLock.Unlock()

	configFilename, err := config.Filename(repoPath)
	if err != nil {
		return nil, err
	}
	return serialize.Load(configFilename)
}
701908
func Config(config amqp.Config) ClientOpt {
	return func(c *Client) {
		c.config = config
	}
}
418697
func LoadConfig(path string) (*Config, error) {
	fi, err := os.Stat(path)
	if err != nil {
		return nil, err
	}

	if fi.IsDir() {
		return LoadConfigDir(path)
	}

	cleaned := filepath.Clean(path)
	config, err := ParseConfigFile(cleaned)
	if err != nil {
		return nil, fmt.Errorf("Error loading %s: %s", cleaned, err)
	}

	config.Files = append(config.Files, cleaned)
	return config, nil
}
817651
func Config(c *cli.Context) {
	// This will create the configuration directory and file if it does not
	// already exist.
	cfg, err := config.New()
	if err != nil {
		log.Fatal(err)
	}

	if c.Bool("server-url") {
		if len(c.Args()) > 1 {
			log.Fatal("invalid number of argument")
		}

		if !c.Args().Present() {
			fmt.Println("server-url = ", cfg.DownloadServerURL)
			return
		}

		cfg.DownloadServerURL = c.Args().First()
		if err = cfg.Save(); err != nil {
			log.Fatal(err)
		}

		log.Success("download server URL successfully updated")
		return
	}
}
95449
func (s *configsService) Config(db *gorm.DB, app *App) (*Config, error) {
	r, err := releasesFind(db, ReleasesQuery{App: app})
	if err != nil {
		if err == gorm.RecordNotFound {
			// It's possible to have config without releases, this handles that.
			c, err := configsFind(db, ConfigsQuery{App: app})
			if err != nil {
				if err == gorm.RecordNotFound {
					// Return an empty config.
					return &Config{
						AppID: app.ID,
						App:   app,
						Vars:  make(Vars),
					}, nil
				}
				return nil, err
			}

			return c, nil
		}

		return nil, err
	}

	return r.Config, nil
}
25601
func (ns *Namespace) Config(path interface{}) (image.Config, error) {
	filename, err := cast.ToStringE(path)
	if err != nil {
		return image.Config{}, err
	}

	if filename == "" {
		return image.Config{}, errors.New("config needs a filename")
	}

	// Check cache for image config.
	ns.cacheMu.RLock()
	config, ok := ns.cache[filename]
	ns.cacheMu.RUnlock()

	if ok {
		return config, nil
	}

	f, err := ns.deps.Fs.WorkingDir.Open(filename)
	if err != nil {
		return image.Config{}, err
	}
	defer f.Close()

	config, _, err = image.DecodeConfig(f)
	if err != nil {
		return config, err
	}

	ns.cacheMu.Lock()
	ns.cache[filename] = config
	ns.cacheMu.Unlock()

	return config, nil
}
859545
func Config() (*DefaultConfig, error) {
	var err error
	config, err := LoadConfig("")
	if err != nil {
		return nil, err
	}

	return config, nil
}
786917
func ReadConfig() (MinikubeConfig, error) {
	f, err := os.Open(constants.ConfigFile)
	if err != nil {
		if os.IsNotExist(err) {
			return make(map[string]interface{}), nil
		}
		return nil, fmt.Errorf("Could not open file %s: %v", constants.ConfigFile, err)
	}
	defer f.Close()

	m, err := decode(f)
	if err != nil {
		return nil, fmt.Errorf("Could not decode config %s: %v", constants.ConfigFile, err)
	}

	return m, nil
}
26707
func (b *backend) Config(ctx context.Context, s logical.Storage) (*config, error) {
	entry, err := s.Get(ctx, "config")
	if err != nil {
		return nil, err
	}

	// Returning a default configuration if an entry is not found
	var result config
	if entry != nil {
		if err := entry.DecodeJSON(&result); err != nil {
			return nil, errwrap.Wrapf("error reading configuration: {{err}}", err)
		}
	}
	return &result, nil
}
1043929
func (s *Storage) Config(c context.Context, cfg storage.Config) error {
	return s.run(func() error {
		s.MaxLogAge = cfg.MaxLogAge
		return nil
	})
}
197649
func (b *Builder) Config() *docker.Config {
	config := b.RunConfig
	if config.OnBuild == nil {
		config.OnBuild = []string{}
	}
	if config.Entrypoint == nil {
		config.Entrypoint = []string{}
	}
	config.Image = ""
	return &config
}
734710
func WriteConfig(filename string, cfg *Config) error {
	b, err := yaml.Marshal(cfg)
	if err != nil {
		return err
	}
	return ioutil.WriteFile(filename, b, 0600)
}