INNER CODE UNIT · Go

localBackendFromConfig

helm/chartmuseum · cmd/chartmuseum/main.go:167

func localBackendFromConfig(conf *config.Config) storage.Backend {
	crashIfConfigMissingVars(conf, []string{"storage.local.rootdir"})
	return storage.NewLocalFilesystemBackend(
		conf.GetString("storage.local.rootdir"),
	)
}

func amazonBackendFromConfig(conf *config.Config) storage.Backend {
	// If using alternative s3 endpoint (e.g. Minio) default region to us-east-1
	if conf.GetString("storage.amazon.endpoint") != "" && conf.GetString("storage.amazon.region") == "" {
		conf.Set("storage.amazon.region", "us-east-1")
	}
	crashIfConfigMissingVars(conf, []string{"storage.amazon.bucket", "storage.amazon.region"})
	forcePathStyle := conf.GetBool("storage.amazon.forcepathstyle")
	return storage.NewAmazonS3BackendWithOptions(
		conf.GetString("storage.amazon.bucket"),
		conf.GetString("storage.amazon.prefix"),
		conf.GetString("storage.amazon.region"),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…