Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

FakeGCSサーバでのアップロードと削除

livebook/practices/gcs_faker.livemd

FakeGCSサーバでのアップロードと削除

alias Bright.Utils.GoogleCloud.Storage

アップロード

obj_path = Path.join([:code.priv_dir(:bright), "static/images", "logo.svg"])
gcs_path = "logo.svg"

Storage.upload!(obj_path, gcs_path)
gcs_public_path = Storage.public_url(gcs_path)
IO.write(gcs_public_path)

削除

Storage.delete!(gcs_path)