Created
February 25, 2022 14:17
-
-
Save pjstadig/5139e0f5d9e757fe5148e398d99199c7 to your computer and use it in GitHub Desktop.
Protocol + client
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
(ns stadig.storage | |
(:refer-clojure :exclude [get]) | |
(:require | |
[stadig.storage.protocol :as proto])) | |
(defn get | |
[conn bucket key] | |
(when-not bucket | |
(throw (ex-info "Expected bucket" {:type ::bucket-error}))) | |
(proto/get conn bucket key)) | |
(defn put | |
[conn bucket key value] | |
(when-not bucket | |
(throw (ex-info "Expected bucket" {:type ::bucket-error}))) | |
(proto/put conn bucket key value)) | |
(defn delete | |
[conn bucket key] | |
(when-not bucket | |
(throw (ex-info "Expected bucket" {:type ::bucket-error}))) | |
(proto/delete conn bucket key)) | |
(defn close | |
[conn] | |
(proto/close conn)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment