-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require AccessToken from top level API calls (#10)
- Loading branch information
1 parent
d0ad75d
commit 21b78f4
Showing
9 changed files
with
114 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
|
||
module Main where | ||
|
||
import System.Directory (doesFileExist) | ||
|
||
import Azure.Auth (defaultAzureCredential) | ||
import Azure.Blob.GetBlob (GetBlob (..), getBlobObject) | ||
import Azure.Blob.Types (AccountName (..), BlobName (..), ContainerName (..)) | ||
import Azure.Types (newEmptyToken) | ||
|
||
main :: IO () | ||
main = do | ||
tok <- newEmptyToken | ||
cred <- defaultAzureCredential Nothing "https://storage.azure.com" tok | ||
-- In order to run this, you need to replace @AccountName@, @ContainerName@ and @BlobName@ | ||
-- with appropriate values in your resource group. These are just dummy values. | ||
let account = AccountName "OneRepublic" | ||
container = ContainerName "Native" | ||
blob = BlobName "counting_stars.jpeg" | ||
getBlobPayload = GetBlob account container blob cred | ||
getBlobObject getBlobPayload "/tmp/counting_stars.jpeg" | ||
doesFileExist "/tmp/counting_stars.jpeg" >>= print |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters