{"id":20780766,"url":"https://github.com/greglook/blocks-s3","last_synced_at":"2025-06-10T18:10:08.789Z","repository":{"id":62433724,"uuid":"45962728","full_name":"greglook/blocks-s3","owner":"greglook","description":"Clojure content-addressable block store backed by Amazon S3.","archived":false,"fork":false,"pushed_at":"2020-04-24T23:47:58.000Z","size":110,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T19:41:27.379Z","etag":null,"topics":["clojure","content-addressable-storage","s3"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greglook.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-11T05:54:12.000Z","updated_at":"2024-06-04T08:31:09.000Z","dependencies_parsed_at":"2022-11-01T21:02:07.826Z","dependency_job_id":null,"html_url":"https://github.com/greglook/blocks-s3","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greglook%2Fblocks-s3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greglook%2Fblocks-s3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greglook%2Fblocks-s3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greglook%2Fblocks-s3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greglook","download_url":"https://codeload.github.com/greglook/blocks-s3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251777830,"owners_count":21642233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","content-addressable-storage","s3"],"created_at":"2024-11-17T13:39:08.448Z","updated_at":"2025-04-30T20:34:04.625Z","avatar_url":"https://github.com/greglook.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"blocks-s3\n=========\n\n[![CircleCI](https://circleci.com/gh/greglook/blocks-s3.svg?style=shield\u0026circle-token=2d7ae95392368c6f66dd93ab63420d0498f2b2fc)](https://circleci.com/gh/greglook/blocks-s3)\n[![codecov](https://codecov.io/gh/greglook/blocks-s3/branch/master/graph/badge.svg)](https://codecov.io/gh/greglook/blocks-s3)\n[![cljdoc lib](https://img.shields.io/badge/cljdoc-lib-blue.svg)](https://cljdoc.org/d/mvxcvi/blocks-s3/)\n\nThis library implements a [content-addressable](https://en.wikipedia.org/wiki/Content-addressable_storage)\n[block store](//github.com/greglook/blocks) backed by a bucket in\n[Amazon S3](https://aws.amazon.com/s3/).\n\n\n## Installation\n\nLibrary releases are published on Clojars. To use the latest version with\nLeiningen, add the following dependency to your project definition:\n\n[![Clojars Project](http://clojars.org/mvxcvi/blocks-s3/latest-version.svg)](http://clojars.org/mvxcvi/blocks-s3)\n\n\n## Usage\n\nThe `blocks.store.s3` namespace provides the `s3-block-store` constructor, or\nyou can use the `s3://\u003cbucket\u003e/\u003cprefix\u003e` URI syntax with `block/-\u003estore`.\nStores are constructed with a bucket name and should usually include a key\nprefix. Each block is stored as a separate object, keyed by the hex-encoded\nmultihash under the store's prefix.\n\nWith no other arguments, this will use the AWS SDK's\n[default logic](http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/credentials.html#credentials-default)\nto find credentials. Otherwise, they can be provided by passing the store a\n`:credentials` value - this can be a custom credentials provider, a static set\nof credentials, or a map with at least an `:access-key` and `:secret-key`\nentries.\n\n```clojure\n=\u003e (require '[blocks.core :as block]\n            '[blocks.store.s3 :refer [s3-block-store]]\n            '[com.stuartsierra.component :as component])\n\n; Create a new block store backed by S3:\n=\u003e (def store\n     (component/start\n       (s3-block-store \"my-bucket\"\n                       :prefix \"foo/bar/\"\n                       :region :us-west-2\n                       :sse :aes-256)))\n\n=\u003e store\n#blocks.store.s3.S3BlockStore\n{:bucket \"my-bucket\",\n :client #\u003ccom.amazonaws.services.s3.AmazonS3Client@27107ade\u003e,\n :prefix \"foo/bar/\",\n :region :us-west-2,\n :sse :aes-256}\n\n; Files can be stored as blocks:\n=\u003e (def readme @(block/store! store (io/file \"README.md\")))\n\n; Returned blocks have S3 storage metadata:\n=\u003e (meta readme)\n#:blocks.store.s3\n{:bucket \"my-bucket\",\n :key \"foo/bar/1220a57d35a4d1b0405b275644fe9f18766a8e662cb56ed48d232a71153a78d81424\",\n :metadata {\"ETag\" \"6aa4f9b538ca79110dfdfeeed92da7f2\",\n            \"x-amz-server-side-encryption\" \"AES256\"}}\n\n; Listing blocks finds objects in the bucket:\n=\u003e (block/list-seq store :limit 5)\n(#blocks.data.Block\n {:id #multi/hash \"1220a57d35a4d1b0405b275644fe9f18766a8e662cb56ed48d232a71153a78d81424\",\n  :size 3152,\n  :stored-at #inst \"2019-03-11T21:30:24Z\"})\n\n; Getting blocks makes a HEAD request to S3 to fetch object metadata.\n=\u003e @(block/get store (:id readme))\n#blocks.data.Block\n{:id #multi/hash \"1220a57d35a4d1b0405b275644fe9f18766a8e662cb56ed48d232a71153a78d81424\",\n :size 3152,\n :stored-at #inst \"2019-03-11T21:30:24Z\"}\n\n; Returned blocks are lazy; content is not streamed until the block is opened.\n=\u003e (block/lazy? *1)\ntrue\n```\n\n\n## License\n\nThis is free and unencumbered software released into the public domain.\nSee the UNLICENSE file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreglook%2Fblocks-s3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreglook%2Fblocks-s3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreglook%2Fblocks-s3/lists"}