diff options
author | Jakob Odersky <jakob@driver.xyz> | 2018-06-29 15:26:09 -0700 |
---|---|---|
committer | Jakob Odersky <jakob@driver.xyz> | 2018-06-29 15:26:09 -0700 |
commit | 901b02274fdfc08030443aac2f1760fc479b3816 (patch) | |
tree | 5d5f6d6d58fc9caa22eb836ccf70936a5b45ab81 /src/main/scala/xyz/driver/core/storage/BlobStorage.scala | |
parent | 981cc63b94c6df5fc8f4d2f6ebafd1a6f27d7c4e (diff) | |
download | driver-core-901b02274fdfc08030443aac2f1760fc479b3816.tar.gz driver-core-901b02274fdfc08030443aac2f1760fc479b3816.tar.bz2 driver-core-901b02274fdfc08030443aac2f1760fc479b3816.zip |
Add build support for ScalaJS
Diffstat (limited to 'src/main/scala/xyz/driver/core/storage/BlobStorage.scala')
-rw-r--r-- | src/main/scala/xyz/driver/core/storage/BlobStorage.scala | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/main/scala/xyz/driver/core/storage/BlobStorage.scala b/src/main/scala/xyz/driver/core/storage/BlobStorage.scala deleted file mode 100644 index ee6c5d7..0000000 --- a/src/main/scala/xyz/driver/core/storage/BlobStorage.scala +++ /dev/null @@ -1,50 +0,0 @@ -package xyz.driver.core.storage - -import java.net.URL -import java.nio.file.Path - -import akka.stream.scaladsl.{Sink, Source} -import akka.util.ByteString -import akka.{Done, NotUsed} - -import scala.concurrent.Future -import scala.concurrent.duration.Duration - -/** Binary key-value store, typically implemented by cloud storage. */ -trait BlobStorage { - - /** Upload data by value. */ - def uploadContent(name: String, content: Array[Byte]): Future[String] - - /** Upload data from an existing file. */ - def uploadFile(name: String, content: Path): Future[String] - - def exists(name: String): Future[Boolean] - - /** List available keys. The prefix determines which keys should be listed - * and depends on the implementation (for instance, a file system backed - * blob store will treat a prefix as a directory path). */ - def list(prefix: String): Future[Set[String]] - - /** Get all the content of a given object. */ - def content(name: String): Future[Option[Array[Byte]]] - - /** Stream data asynchronously and with backpressure. */ - def download(name: String): Future[Option[Source[ByteString, NotUsed]]] - - /** Get a sink to upload data. */ - def upload(name: String): Future[Sink[ByteString, Future[Done]]] - - /** Delete a stored value. */ - def delete(name: String): Future[String] - - /** - * Path to specified resource. Checks that the resource exists and returns None if - * it is not found. Depending on the implementation, may throw. - */ - def url(name: String): Future[Option[URL]] -} - -trait SignedBlobStorage extends BlobStorage { - def signedDownloadUrl(name: String, duration: Duration): Future[Option[URL]] -} |