summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorILYA Khlopotov <iilyak@apache.org>2021-01-29 04:27:34 -0800
committerILYA Khlopotov <iilyak@apache.org>2021-04-26 14:15:57 -0700
commit845f917e35005a84ee790cd9cb9918d0b5be25ef (patch)
treead31a5dbdfe9c7c96507395d37a9e248cc1dab6d
parent2e1fbc2f7d5568cacc299c199fad2d9df5afa830 (diff)
downloadcouchdb-845f917e35005a84ee790cd9cb9918d0b5be25ef.tar.gz
Create couch_lib application
-rw-r--r--rebar.config.script1
-rw-r--r--rel/reltool.config2
-rw-r--r--src/couch_lib/.gitignore21
-rw-r--r--src/couch_lib/README.md21
-rw-r--r--src/couch_lib/src/couch_lib.app.src22
5 files changed, 67 insertions, 0 deletions
diff --git a/rebar.config.script b/rebar.config.script
index 6dafa8f89..e61b5aaa5 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -119,6 +119,7 @@ SubDirs = [
"src/couch",
"src/couch_eval",
"src/couch_js",
+ "src/couch_lib",
"src/couch_replicator",
"src/couch_stats",
"src/couch_tests",
diff --git a/rel/reltool.config b/rel/reltool.config
index 7d3599331..a1cc938c1 100644
--- a/rel/reltool.config
+++ b/rel/reltool.config
@@ -35,6 +35,7 @@
couch,
couch_epi,
couch_jobs,
+ couch_lib,
couch_log,
couch_replicator,
couch_stats,
@@ -93,6 +94,7 @@
{app, couch_eval, [{incl_cond, include}]},
{app, couch_js, [{incl_cond, include}]},
{app, couch_jobs, [{incl_cond, include}]},
+ {app, couch_lib, [{incl_cond, include}]},
{app, couch_log, [{incl_cond, include}]},
{app, couch_replicator, [{incl_cond, include}]},
{app, couch_stats, [{incl_cond, include}]},
diff --git a/src/couch_lib/.gitignore b/src/couch_lib/.gitignore
new file mode 100644
index 000000000..fed08d1ca
--- /dev/null
+++ b/src/couch_lib/.gitignore
@@ -0,0 +1,21 @@
++*.o
++*.so
++*.lib
++*.dll
++*.d/
++
++ebin/
++.eunit
++.rebar
++
++*.plt
++*.swp
++*.swo
++.erlang.cookie
++erl_crash.dump
++.idea
++.vscode
++*.iml
++rebar.lock
++_*
++*~ \ No newline at end of file
diff --git a/src/couch_lib/README.md b/src/couch_lib/README.md
new file mode 100644
index 000000000..c5f0b366f
--- /dev/null
+++ b/src/couch_lib/README.md
@@ -0,0 +1,21 @@
+# Description
+
+`couch_lib` application is a collection of "pure" miscellaneous functions.
+They are "pure" in a sense that these functions should not call any other CouchDB
+applications. Think of this application as an extension for Erlang/OTP standard library.
+
+The two main reasons for this application to exist are:
+
+- to share non CouchDB specific helper functions between applications
+- avoid or break cyclic dependencies between applications
+
+Please DO NOT put CouchDB specific functionality in here. This means you shouldn't:
+
+- call couch_log:
+- call config:
+- rely on process dictionary values set by processes within CouchDB using `erlang:put/2`
+- send messages to specific `gen_server` processes using `gen_server:call`
+
+# Provided functionality
+
+
diff --git a/src/couch_lib/src/couch_lib.app.src b/src/couch_lib/src/couch_lib.app.src
new file mode 100644
index 000000000..1f78cf9fd
--- /dev/null
+++ b/src/couch_lib/src/couch_lib.app.src
@@ -0,0 +1,22 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+{application, couch_lib, [
+ {description, "CouchDB library of various helpers"},
+ {vsn, git},
+ {registered, [
+ ]},
+ {applications, [
+ kernel,
+ stdlib
+ ]}
+]}.