azblob
Version, currently 0.1.01 version
- 0.1.0latestOct 9, 2024
github.com/spider-gazelle/azblob.cr
Azure Blob Storage shard for Crystal
1 stars
2 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
azblob:
github: spider-gazelle/azblob.cr
version: ~> 0.1.0Then run:
shards installshard.yml
- Crystal
>= 1.13.2- License
- MIT
- Author
- Ali Naqvi
Dependencies
Runtime Dependencies
- db*github: crystal-lang/crystal-db
- connect-proxy*github: spider-gazelle/connect-proxy
README
azblob.cr
Azure Blob Storage shard for Crystal. Supports
Use concurrency when upload/download size exceeds Azure given limits for one request
-
Containers
- Create
- Delete
- List
-
Blob
- List
- Upload
- Download
- Delete
-
BlockBlob
- Upload
- Download
-
Shared Storage Access (SAS)
- Blob
- Container
Listoperations are Paginated
Environment Variables
AZURE_STORAGE_ACCOUNT_NAMEAZURE_STORAGE_ACCOUNT_KEYAZURE_STORAGE_CONNECTION_STRINGhttps_proxy- Proxy address (if used)http_proxy- Proxy address (if used)
Use either AZURE_STORAGE_CONNECTION_STRING or combination AZURE_STORAGE_ACCOUNT_NAME and AZURE_STORAGE_ACCOUNT_KEY
Installation
-
Add the dependency to your
shard.yml:dependencies: azblob: github: spider-gazelle/azblob.cr -
Run
shards install
Usage
require "azblob"
# Create Client via one of the multiple options given
client = AZBlob.client_from_env # client from environment variables
# OR
client = AZBlob.client(connection_string, optional_proxy) # client with given connection string via code
# OR
client = AZBlob::Client.new(config) # client with Client::Config object
# Create container
client.create_container(container-name, metadata) # metadata is optional key/value hash
# Delete container
client.delete_container(container-name)
# List containers
iter = client.list_containers(max_results: 3)
iter.each do |page|
page.containers.each do{ |c| puts c.name }
end
# List blobs
iter = client.list_blobs(max_results: 3)
iter.each do |page|
.... # page other attributes
page.blobs.each .....
end
# upload blob
client.put_blob(...) # various overloads provided
# download blob
client.get_blob(container,blob-name, options)
# Pre-Sign URL (SAS URL)
client.blob_sas(.....)
client.container_sas(.....)
Development
Contributing
- Fork it (https://github.com/spider-gazelle/azblob.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Ali Naqvi - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Oct 9, 2024
- Commit
16b822289fca- Crystal
>= 1.13.2- Indexed
- yes
Dependents
Repository
github.com/spider-gazelle/azblob.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1