コード例 #1
0
ファイル: server-config.go プロジェクト: nohitall/minio
// 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
}
コード例 #2
0
ファイル: web-config.go プロジェクト: m120/minio
// 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
}
コード例 #3
0
ファイル: config.go プロジェクト: AcalephStorage/minio
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
}
コード例 #4
0
ファイル: config.go プロジェクト: AcalephStorage/minio
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
}
コード例 #5
0
ファイル: config.go プロジェクト: fwessels/mc
// 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
	}
}
コード例 #6
0
ファイル: user_test.go プロジェクト: AcalephStorage/minio
func (s *MySuite) TestHomeDir(c *C) {
	_, err := user.HomeDir()
	c.Assert(err, IsNil)
}