Ejemplo n.º 1
0
// getConfigPath get users config path
func getConfigPath() (string, *probe.Error) {
	if customConfigPath != "" {
		return customConfigPath, nil
	}
	homeDir, e := user.HomeDir()
	if e != nil {
		return "", probe.NewError(e)
	}
	configPath := filepath.Join(homeDir, ".minio")
	return configPath, nil
}
Ejemplo n.º 2
0
// getWebConfigDir get web config dir.
func getWebConfigDir() (string, *probe.Error) {
	if customWebConfigDir != "" {
		return customWebConfigDir, nil
	}
	homeDir, e := user.HomeDir()
	if e != nil {
		return "", probe.NewError(e)
	}
	webConfigDir := filepath.Join(homeDir, ".minio", "web")
	return webConfigDir, nil
}
Ejemplo n.º 3
0
func getFSMultipartsSessionConfigPath() (string, *probe.Error) {
	if customMultipartsConfigPath != "" {
		return customMultipartsConfigPath, nil
	}
	homeDir, e := user.HomeDir()
	if e != nil {
		return "", probe.NewError(e)
	}
	fsMultipartsConfigPath := filepath.Join(homeDir, ".minio", "$multiparts-session.json")
	return fsMultipartsConfigPath, nil
}
Ejemplo n.º 4
0
func getFSBucketsConfigPath() (string, *probe.Error) {
	if customBucketsConfigPath != "" {
		return customBucketsConfigPath, nil
	}
	homeDir, e := user.HomeDir()
	if e != nil {
		return "", probe.NewError(e)
	}
	fsBucketsConfigPath := filepath.Join(homeDir, ".minio", "$buckets.json")
	return fsBucketsConfigPath, nil
}
Ejemplo n.º 5
0
// getMcConfigDir - construct minio client config folder.
func getMcConfigDir() (string, *probe.Error) {
	if mcCustomConfigDir != "" {
		return mcCustomConfigDir, nil
	}
	homeDir, e := user.HomeDir()
	if e != nil {
		return "", probe.NewError(e)
	}
	// For windows the path is slightly different
	switch runtime.GOOS {
	case "windows":
		return filepath.Join(homeDir, globalMCConfigWindowsDir), nil
	default:
		return filepath.Join(homeDir, globalMCConfigDir), nil
	}
}
Ejemplo n.º 6
0
func (s *MySuite) TestHomeDir(c *C) {
	_, err := user.HomeDir()
	c.Assert(err, IsNil)
}