Skip to content

Commit

Permalink
[doc] compiler, database, dropbox: doc updated
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricss committed Sep 25, 2012
1 parent b2a5101 commit e489263
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 20 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG
@@ -1,10 +1,13 @@
Feature:

* New Dropbox database backend (experimental)

Updated APIs:

* File:
- depreacted `content` and `content_opt`, replaced by `read` and `read_opt`
- added `write` and `mkdir` function


2012.09.10, Version 1.0.6 (stable), v3375

New features:
Expand Down
7 changes: 7 additions & 0 deletions compiler/opa/pass_MongoAccessGeneration.ml
Expand Up @@ -16,6 +16,13 @@
along with Opa. If not, see <http://www.gnu.org/licenses/>.
*)


(**
Pass for MongoDB backend
@author Quentin Bourgerie
*)

(* shorthands *)
module Q = QmlAst
module C = QmlAstCons.TypedExpr
Expand Down
4 changes: 4 additions & 0 deletions compiler/opalang/opaPrint.mli
Expand Up @@ -17,6 +17,10 @@
*)
(**
A family of pretty-printers for the Opa AST.
@author Mathieu Barbin
@author Rudy Sicard
@author Cedric Soulas
*)
type 'ident printer =
<
Expand Down
8 changes: 8 additions & 0 deletions opa/pass_DropBoxCodeGeneration.ml
Expand Up @@ -16,6 +16,14 @@
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*)


(**
Pass for Dropbox database backend
@author Quentin Bourgerie
@author Cedric Soulas
*)

(* shorthands *)
module Q = QmlAst
module C = QmlAstCons.TypedExpr
Expand Down
51 changes: 32 additions & 19 deletions stdlib/database/dropbox/db.opa
@@ -1,24 +1,21 @@
/*
Copyright © 2011, 2012 MLstate
This file is part of OPA.
This file is part of Opa.
OPA is free software: you can redistribute it and/or modify it under the
Opa is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.
OPA is distributed in the hope that it will be useful, but WITHOUT ANY
Opa is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
more details.
You should have received a copy of the GNU Affero General Public License
along with OPA. If not, see <http://www.gnu.org/licenses/>.
along with Opa. If not, see <http://www.gnu.org/licenses/>.
*/

/**
*
*/

package stdlib.database.dropbox

Expand All @@ -30,14 +27,15 @@ import stdlib.core.rpc.core
import stdlib.io.file

/**
* {1 About this module}
*
* {1 Where do I start?}
*
* {1 What if I need more?}
* Dropbox database backend
* Looking for Dropbox API? Find it in stdlib.apis.dropbox
*
* @category database
* @author Cedric Soulas
* @destination experimental
*/


/**
* {1 Types defined in this module}
*/
Expand Down Expand Up @@ -128,6 +126,21 @@ DbDropbox = {{

}}

/**
Wrapper around Dropbox Auth module (stdlib.apis.dropbox)
to manipulate the User crendentials,
based on the context stored in the database in parameter.
Example:
[
database db_dropbox @dropbox {
stringmap(int) /test
}
DbU = DbDropbox.User(db_dropbox)
url = DbU.get_login_url(redirect)
]
*/
User(db : DbDropbox.t) = {{

get_status = _User(db).get_status
Expand Down Expand Up @@ -159,14 +172,14 @@ DbDropbox = {{
| { failure = { not_found }} -> do error("Unbound path {path}"); []
| { failure = failure } -> do error("Unexepected error: {failure}"); []

/**
- all elements are requested in parallel (would be too slow in sequence!)
- responses are received in a random order (random time response)
- an element is safely added to the map via a cell
- a counter is used to know when all elements are retrieved
- no callback argument: the map is return thanks to @callcc
*/
@package @server read_map(db:DbDropbox.t, creds, path:string, kty, dty):stringmap('data) =
/**
- all elements are requested in parallel (would be too slow in sequence!)
- responses are received in a random order (random time response)
- an element is safely added to the map via a cell
- a counter is used to know when all elements are retrieved
- no callback argument: the map is return thanks to @callcc
*/
Map = Map_make(Order.make_unsafe(OpaValue.compare_with_ty(_, _, kty)))
l = get_path_list(db, creds, path)
if l == [] then Map.empty else
Expand Down

0 comments on commit e489263

Please sign in to comment.