]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/s3/s3-docs.factor
stomp.cli: simplify
[factor.git] / extra / s3 / s3-docs.factor
index 6f9c10010da2d4e06031979aa53e60528f906a93..79718f368a30f8257af2846a6fb71f6aad3e6873 100644 (file)
-! Copyright (C) 2009 Chris Double.\r
-! See http://factorcode.org/license.txt for BSD license.\r
-USING: help.markup help.syntax ;\r
-IN: s3\r
-\r
-HELP: buckets\r
-{ $values \r
-  { "seq" "a sequence of " { $link bucket } " objects" } \r
-}\r
-{ $description \r
-    "Returns a list of " { $link bucket } " objects containing data on the buckets available on S3."}\r
-{ $examples\r
-  { $unchecked-example "USING: s3 ;" "buckets ." "{ }" }\r
-}\r
-;\r
-\r
-HELP: create-bucket\r
-{ $values \r
-  { "bucket" "a string" } \r
-}\r
-{ $description \r
-    "Creates a bucket with the given name."\r
-} \r
-{ $examples\r
-  { $unchecked-example "USING: s3 ;" "\"testbucket\" create-bucket" "" }\r
-}\r
-;\r
-\r
-HELP: delete-bucket\r
-{ $values \r
-  { "bucket" "a string" } \r
-}\r
-{ $description \r
-    "Deletes the bucket with the given name."\r
-} \r
-{ $examples\r
-  { $unchecked-example "USING: s3 ;" "\"testbucket\" delete-bucket" "" }\r
-}\r
-;\r
-\r
-HELP: keys\r
-{ $values \r
-  { "bucket" "a string" } \r
-  { "seq" "a sequence of " { $link key } " objects"\r
-}\r
-{ $description \r
-    "Returns a sequence of " { $link key } " objects. Each object in the sequence has information about the keys contained within the bucket."\r
-} \r
-{ $examples\r
-  { $unchecked-example "USING: s3 ;" "\"testbucket\" keys . " "{ }" }\r
-}\r
-;\r
-\r
-HELP: get-object\r
-{ $values \r
-  { "bucket" "a string" } \r
-  { "key" "a string" } \r
-  { "response" "The HTTP response object"\r
-  { "data" "The data returned from the http request"\r
-}\r
-{ $description \r
-    "Does an HTTP request to retrieve the object in the bucket with the given key."\r
-} \r
-{ $examples\r
-  { $unchecked-example "USING: s3 ;" "\"testbucket\" \"mykey\" http-get " "" }\r
-}\r
-;\r
-\r
-HELP: put-object\r
-{ $values \r
-  { "data" "an object" } \r
-  { "mime-type" "a string" } \r
-  { "bucket" "a string"} \r
-  { "key" "a string"} \r
-  { "headers" "an assoc"} \r
-}\r
-{ $description \r
-    "Stores the object under the key in the given bucket. The object has "\r
-"the given mimetype. 'headers' should contain key/values for any headers to "\r
-"be associated with the object. 'data' is any Factor object that can be "\r
-"used as the 'data' slot in <post-data>. If it's a <pathname> it stores "\r
-"the contents of the file. If it's a stream, it's the contents of the "\r
-"stream, etc."\r
-} \r
-{ $examples\r
-  { $unchecked-example "USING: s3 ;" "\"hello\" binary encode \"text/plain\" \"testbucket\" \"hello.txt\" H{ { \"x-amz-acl\" \"public-read\" } } put-object" "" }\r
-  { $unchecked-example "USING: s3 ;" "\"hello.txt\" <pathname> \"text/plain\" \"testbucket\" \"hello.txt\" H{ { \"x-amz-acl\" \"public-read\" } } put-object" "" }\r
-}\r
-;\r
-\r
-HELP: delete-object\r
-{ $values \r
-  { "bucket" "a string"} \r
-  { "key" "a string"} \r
-}\r
-{ $description \r
-    "Deletes the object in the bucket with the given key."\r
-} \r
-{ $examples\r
-  { $unchecked-example "USING: s3 ;" "\"testbucket\" \"mykey\" delete-object" "" }\r
-}\r
-;\r
-\r
-ARTICLE: "s3" "Amazon S3"\r
-"The " { $vocab-link "s3" } " vocabulary provides a wrapper to the Amazon "\r
-"Simple Storage Service API."\r
-$nl\r
-"To use the api you must set the variables " { $link key-id } " and " \r
-{ $link secret-key } " to your Amazon S3 key and secret key respectively. Once "\r
-"this is done you can call any of the words below."\r
-{ $subsections buckets\r
-    create-bucket\r
-    delete-bucket\r
-    keys\r
-    get-object\r
-    put-object\r
-    delete-object\r
-}\r
-;\r
-\r
-ABOUT: "s3"\r
+! Copyright (C) 2009 Chris Double.
+! See https://factorcode.org/license.txt for BSD license.
+USING: assocs help.markup help.syntax kernel strings ;
+IN: s3
+
+HELP: buckets
+{ $values
+  { "seq" "a sequence of " { $link bucket } " objects" }
+}
+{ $description
+    "Returns a list of " { $link bucket } " objects containing data on the buckets available on S3." }
+{ $examples
+  { $unchecked-example "USING: s3 ;" "buckets ." "{ }" }
+}
+;
+
+HELP: create-bucket
+{ $values
+  { "bucket" string }
+}
+{ $description
+    "Creates a bucket with the given name."
+}
+{ $examples
+  { $unchecked-example "USING: s3 ;" "\"testbucket\" create-bucket" "" }
+}
+;
+
+HELP: delete-bucket
+{ $values
+  { "bucket" string }
+}
+{ $description
+    "Deletes the bucket with the given name."
+}
+{ $examples
+  { $unchecked-example "USING: s3 ;" "\"testbucket\" delete-bucket" "" }
+}
+;
+
+HELP: keys
+{ $values
+  { "bucket" string }
+  { "seq" "a sequence of " { $link key } " objects" }
+}
+{ $description
+    "Returns a sequence of " { $link key } " objects. Each object in the sequence has information about the keys contained within the bucket."
+}
+{ $examples
+  { $unchecked-example "USING: s3 ;" "\"testbucket\" keys . " "{ }" }
+}
+;
+
+HELP: get-object
+{ $values
+  { "bucket" string }
+  { "key" string }
+  { "response" "The HTTP response object" }
+  { "data" "The data returned from the http request" }
+}
+{ $description
+    "Does an HTTP request to retrieve the object in the bucket with the given key."
+}
+{ $examples
+  { $unchecked-example "USING: s3 ;" "\"testbucket\" \"mykey\" http-get " "" }
+}
+;
+
+HELP: put-object
+{ $values
+  { "data" object }
+  { "mime-type" string }
+  { "bucket" string }
+  { "key" string }
+  { "headers" assoc }
+}
+{ $description
+    "Stores the object under the key in the given bucket. The object has "
+"the given mimetype. 'headers' should contain key/values for any headers to "
+"be associated with the object. 'data' is any Factor object that can be "
+"used as the 'data' slot in <post-data>. If it's a <pathname> it stores "
+"the contents of the file. If it's a stream, it's the contents of the "
+"stream, etc."
+}
+{ $examples
+  { $unchecked-example "USING: s3 ;" "\"hello\" binary encode \"text/plain\" \"testbucket\" \"hello.txt\" H{ { \"x-amz-acl\" \"public-read\" } } put-object" "" }
+  { $unchecked-example "USING: s3 ;" "\"hello.txt\" <pathname> \"text/plain\" \"testbucket\" \"hello.txt\" H{ { \"x-amz-acl\" \"public-read\" } } put-object" "" }
+}
+;
+
+HELP: delete-object
+{ $values
+  { "bucket" string }
+  { "key" string }
+}
+{ $description
+    "Deletes the object in the bucket with the given key."
+}
+{ $examples
+  { $unchecked-example "USING: s3 ;" "\"testbucket\" \"mykey\" delete-object" "" }
+}
+;
+
+ARTICLE: "s3" "Amazon S3"
+"The " { $vocab-link "s3" } " vocabulary provides a wrapper to the Amazon "
+"Simple Storage Service API."
+$nl
+"To use the api you must set the variables " { $link key-id } " and "
+{ $link secret-key } " to your Amazon S3 key and secret key respectively. Once "
+"this is done you can call any of the words below."
+{ $subsections buckets
+    create-bucket
+    delete-bucket
+    keys
+    get-object
+    put-object
+    delete-object
+}
+;
+
+ABOUT: "s3"