Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed the options stuff, phew :)

  • Loading branch information...
commit 214465f3250414c128fba319241978b9e59be458 1 parent 3153baa
@AlexBaranosky AlexBaranosky authored
Showing with 11 additions and 11 deletions.
  1. +10 −10 src/sumo/client.clj
  2. +1 −1  test/sumo/test/client.clj
View
20 src/sumo/client.clj
@@ -113,37 +113,37 @@
[^RawClient client]
(or (.ping client) true))
-(defn- get-raw [^RawClient client bucket key & {:as options}]
- (let [fetch-meta (fetch-options (typed-options (or options {})))
+(defn get-raw [^RawClient client bucket key & options]
+ (let [fetch-meta (fetch-options (typed-options (or (first options) {})))
results (.fetch client ^String bucket ^String key ^FetchMeta fetch-meta)]
(map riak-object-to-map results)))
-(defn get [^RawClient client bucket key & {:as options}]
+(defn get [^RawClient client bucket key & options]
"Retrieve a lazy-seq of objects at `bucket` and `key`
Usage looks like:
(def results (sumo.client/get client \"bucket\" \"key\"))
(println (:value (first (results))))"
- (let [results (apply get-raw client bucket key (mapcat vec (or options {})))]
+ (let [results (get-raw client bucket key (or (first options) {}))]
(for [r results]
(assoc r :value (deserialize r)))))
-(defn- put-raw [^RawClient client bucket key obj & {:as options}]
+(defn put-raw [^RawClient client bucket key obj & options]
(let [riak-object (map-to-riak-object bucket key obj)
- store-meta (store-options (typed-options (or options {})))
+ store-meta (store-options (typed-options (or (first options) {})))
results (.store client ^IRiakObject riak-object ^StoreMeta store-meta)]
(map riak-object-to-map results)))
-(defn put [^RawClient client bucket key obj & {:as options}]
+(defn put [^RawClient client bucket key obj & options]
"Store an object into Riak.
Usage looks like:
(sumo.client/put client \"bucket\" \"key\" {:content-type \"text/plain\" :value \"hello!\"})"
(let [new-obj (assoc obj :value (serialize obj))
- results (apply put-raw client bucket key new-obj (mapcat vec (or options {})))]
+ results (put-raw client bucket key new-obj (or (first options) {}))]
(for [r results]
(assoc r :value (deserialize r)))))
-(defn delete [^RawClient client bucket key & {:as options}]
- (let [delete-meta (delete-options (typed-options options))]
+(defn delete [^RawClient client bucket key & options]
+ (let [delete-meta (delete-options (typed-options (or (first options) {})))]
(.delete client ^String bucket ^String key ^DeleteMeta delete-meta))
true)
View
2  test/sumo/test/client.clj
@@ -14,7 +14,7 @@
(let [put-ret (client/put c "test-bucket" "get-head"
{:content-type "text/plain"
:value "get-head test"})
- get-ret (client/get c "test-bucket" "get-head" :head true)]
+ get-ret (client/get c "test-bucket" "get-head" {:head true})]
(is (= ""
(:value (first get-ret))))))
Please sign in to comment.
Something went wrong with that request. Please try again.