Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.69 KB

README.md

File metadata and controls

55 lines (40 loc) · 1.69 KB

GCS (Google Cloud Storage) backend

Dependency

compile "com.avast.clients.storage:storage-client-gcs_2.13:x.x.x"

Usage

Configuration:

projectId = "my-project-id"
bucketName = "bucket-name"

Authentication

GCS backends supports multiple ways of authentication:

Object decompression

GCS backend supports decompression of objects. The decision whether to decompress object or not is based on the comp-type header in the object's metadata. If the header is present and contains zstd value, the object is decompressed on the fly. Otherwise the object is downloaded as is.

The only supported compression algorithm is currently zstd.

Client initialization

Example for monix.eval.Task:

import com.avast.clients.storage.gcs.GcsStorageBackend
import com.typesafe.config.Config
import monix.eval.Task
import monix.execution.Scheduler
import cats.effect.Blocker

implicit val scheduler: Scheduler = ???
val blocker: Blocker = ???
val config: Config = ???

GcsStorageBackend.fromConfig[Task](config, blocker).map{ resource =>
  resource.use { client =>
    client.get(sha256, destinationFile)
  }
}