summaryrefslogtreecommitdiff
path: root/configs
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2013-01-25 14:01:04 +0000
committerJoshua Colp <jcolp@digium.com>2013-01-25 14:01:04 +0000
commit3fa4278a31d0f6f738b951c0d592941281aed196 (patch)
treeff960ccaa22aac704e984e149a5f5ccb80271a6e /configs
parente9446501c9176b6c05b4a59f88090250b7f04fea (diff)
Merge the sorcery data access layer API.
Sorcery is a unifying data access layer which provides a pluggable mechanism to allow object creation, retrieval, updating, and deletion using different backends (or wizards). This is a fancy way of saying "one interface to rule them all" where them is configuration, realtime, and anything else that comes along. Review: https://reviewboard.asterisk.org/r/2259/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'configs')
-rw-r--r--configs/sorcery.conf.sample50
-rw-r--r--configs/test_sorcery.conf.sample14
2 files changed, 64 insertions, 0 deletions
diff --git a/configs/sorcery.conf.sample b/configs/sorcery.conf.sample
new file mode 100644
index 000000000..899467a4e
--- /dev/null
+++ b/configs/sorcery.conf.sample
@@ -0,0 +1,50 @@
+; Sample configuration file for Sorcery Data Access Layer
+
+;
+; Wizards
+;
+; Wizards are the persistence mechanism for objects. They are loaded as Asterisk modules and register
+; themselves with the sorcery core. All implementation specific details of how objects are persisted is isolated
+; within wizards.
+;
+
+;
+; Caching
+;
+; A wizard can optionally be marked as an object cache by adding "/cache" to the object type within the mapping.
+; If an object is returned from a non-object cache it is immediately given to the cache to be created. Multiple
+; object caches can be configured for a single object type.
+;
+
+;
+; Object Type Mappings
+;
+; To allow configuration of where and how an object is persisted object mappings can be defined within this file
+; on a per-module basis. The mapping consists of the object type, options, wizard name, and wizard configuration
+; data. This has the following format:
+;
+; object type [/options] = wizard name, wizard configuration data
+;
+; For example to configure an in-memory wizard for the 'bob' object type:
+;
+; bob = memory
+;
+; Or to configure the object type 'joe' from a configuration file:
+;
+; joe = config,joe.conf
+;
+; Note that an object type can have multiple mappings defined. Each mapping will be consulted in the order in which
+; it appears within the configuration file. This means that if you are configuring a wizard as a cache it should
+; appear as the first mapping so the cache is consulted before all other mappings.
+;
+
+;
+; The following object mappings are used by the unit test to test certain functionality of sorcery.
+;
+[test_sorcery]
+test=memory
+
+[test_sorcery_cache]
+test/cache=test
+test=memory
+
diff --git a/configs/test_sorcery.conf.sample b/configs/test_sorcery.conf.sample
new file mode 100644
index 000000000..c465dbf74
--- /dev/null
+++ b/configs/test_sorcery.conf.sample
@@ -0,0 +1,14 @@
+; This is a res_sorcery_config compatible file for the sorcery unit tests
+
+[hey]
+bob=98
+joe=41
+
+[hey2]
+type=zombies
+bob=97
+joe=40
+
+[hey3]
+bob=96
+joe=39