SNRK-76: Format files

This commit is contained in:
Kirill Grachev 2023-05-15 18:09:15 +03:00
parent 028cf631f4
commit 81c7bbb073
2 changed files with 4 additions and 6 deletions

View File

@ -12,14 +12,14 @@ public sealed interface Config {
public fun build(): Directory public fun build(): Directory
} }
public data class LocalConfig(val path: Path): Config { public data class LocalConfig(val path: Path) : Config {
override fun build(): Directory { override fun build(): Directory {
return localStorage(path) return localStorage(path)
} }
} }
/* /*
* `~/.aws/credentials.json file is required * ~/.aws/credentials.json file is required
*/ */
internal fun buildS3Client(regionSpec: String): S3Client { internal fun buildS3Client(regionSpec: String): S3Client {
return S3Client { return S3Client {
@ -27,13 +27,13 @@ internal fun buildS3Client(regionSpec: String): S3Client {
} }
} }
public data class S3BucketConfig(val bucketName: String, val region: String = DEFAULT_REGION): Config { public data class S3BucketConfig(val bucketName: String, val region: String = DEFAULT_REGION) : Config {
override fun build(): Directory { override fun build(): Directory {
return s3Bucket(buildS3Client(region), bucketName) return s3Bucket(buildS3Client(region), bucketName)
} }
} }
public data class S3ServiceConfig(val region: String = DEFAULT_REGION): Config { public data class S3ServiceConfig(val region: String = DEFAULT_REGION) : Config {
override fun build(): Directory { override fun build(): Directory {
return s3Storage(buildS3Client(region)) return s3Storage(buildS3Client(region))
} }

View File

@ -1,7 +1,5 @@
package space.kscience.snark.storage package space.kscience.snark.storage
import space.kscience.snark.storage.local.localStorage
import space.kscience.snark.storage.s3.s3Bucket
import java.nio.file.Path import java.nio.file.Path
import kotlin.io.path.Path import kotlin.io.path.Path