My favorites | Sign in
Project Logo
                
Search
for
Updated Apr 11, 2008 by vi...@tarpipe.com
APIDocumentation  
eCouch API documentation

Module ecouch

eCouch is an Erlang application that provides access to CouchDb servers.

Copyright © 2008 Vitor Rodrigues

Version: 0.1

Behaviours: application.

Authors: Vitor Rodrigues (vitor tarpipe (dot) com).

Characteristics

Data Types

array() = val()

host() = string()

json() = obj() | array() | num() | str() | true | false | null

key() = str() | atom()

num() = int() | float()

obj() = {obj, [{key(), val()}]}

startargs() = {host(), tcp_port()}

str() = bin()

tcp_port() = int()

val() = obj() | array() | num() | str() | true | false | null

Function Details

db_create/1

db_create(DatabaseName::string()) -> ok | {error, Reason::term()}

Create a database

db_delete/1

db_delete(DatabaseName::string()) -> ok | {error, Reason::term()}

Delete a database

db_info/1

db_info(DatabaseName::string()) -> {ok, Info::json()} | {error, Reason::term()}

Database info

db_list/0

db_list() -> ok | {error, Reason::term()}

List databases

doc_create/2

doc_create(DatabaseName::string(), Doc::json()) -> {ok, Response::json()} | {error, Reason::term()}

Create document

doc_create/3

doc_create(DatabaseName::string(), DocName::string(), Doc::json()) -> {ok, Response::json()} | {error, Reason::term()}

Create a named document

doc_delete/3

doc_delete(DatabaseName::string(), DocName::string(), Rev::string()) -> {ok, Response::json()} | {error, Reason::term()}

Delete document

doc_get/2

doc_get(DatabaseName::string(), DocName::string) -> {ok, Response::json()} | {error, Reason::term()}

Get document

doc_get/3

doc_get(DatabaseName::string(), DocName::string(), Options::options()) -> {ok, Response::json()} | {error, Reason::term()}

Get document

doc_get_all/1

doc_get_all(DatabaseName::string()) -> {ok, Response::json()} | {error, Reason::term()}

Get all documents

doc_get_all/2

doc_get_all(DatabaseName::string(), Options::options()) -> {ok, Response::json()} | {error, Reason::term()}

Get all documents

doc_update/3

doc_update(DatabaseName::string(), DocName::string(), Doc::json()) -> {ok, Response::json()} | {error, Reason::term()}

Update document

start/2

start(Type::Type, StartArgs::startargs()) -> {ok, Pid} | {ok, Pid, State} | {error, Reason}

This function is called whenever an application is started using application:start/1,2, and should start the processes of the application. If the application is structured according to the OTP design principles as a supervision tree, this means starting the top supervisor of the tree.

stop/1

stop(State) -> void()

This function is called whenever an application has stopped. It is intended to be the opposite of Module:start/2 and should do any necessary cleaning up. The return value is ignored.

view_adhoc/2

view_adhoc(DatabaseName::string(), Fun::json()) -> {ok, Response::json()} | {error, Reason::term()}

Access an adhoc view

view_adhoc/3

view_adhoc(DatabaseName::string(), Fun::json(), Options::options()) -> {ok, Response::json} | {error, Reason::term()}

Access an adhoc view


Sign in to add a comment
Hosted by Google Code