couchdb_adapter v0.1.0 CouchDB.Environment

Environment module for CouchDB adapter.

Reads configuration data from CouchDB Adapter / Phoenix environment confirugation files or receives from COUCHDB_* environment variables from OS.

Defining custom types and variables

Exactly:

hostname: “localhost” protocol: “https” port: “5984” database_name: “db_name”

auth_type: :basic #possible: :basic, :cookie (aka session auth), :oauth

server_admin: :true server_admin_username: “servadmin” server_admin_password: “secret”

db_admin: :true db_admin_username: “dbadmin” db_admin_password: “secret”

db_user: :true db_user_username: “dbadmin” db_user_password: “secret”

Summary

Types

Username and password for basic authentication

Username and password for basic authentication

CouchDB connection credentials

HTTP headers are modeled as a list of name-value tuples

User information

CouchDB user role is just a string, user_roles a list of strings

Types

auth_type()
auth_type() :: [String.t]

Username and password for basic authentication

basic_auth()
basic_auth() :: %{user: String.t, password: String.t}

Username and password for basic authentication

conn()
conn() :: %{protocol: String.t, hostname: String.t, database: String.t, port: non_neg_integer, user: String.t, password: String.t}

CouchDB connection credentials.

headers()
headers() :: [{String.t, String.t}]

HTTP headers are modeled as a list of name-value tuples

user_info()
user_info() :: %{user: String.t, password: String.t}

User information

user_roles()
user_roles() :: [String.t]

CouchDB user role is just a string, user_roles a list of strings.

Functions

admin_path()
admin_url()
auth_type()
base_url()
dbprops()

Reading connection credentials from environment.

Examples

iex> CouchDB.conn
:world
oauth_creds()
server_admin()