aboutsummaryrefslogtreecommitdiff
path: root/mod/options.cli
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-04-21 16:05:13 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-04-21 16:05:13 +0200
commit2a0f39b29c1bea6a4497c0f1826052ffa453af9e (patch)
tree283f6bf1569c1b9f00b6e25fe986ccfff8a8629f /mod/options.cli
parentc6b4d6c6489731eedba606d3c85c4319c4478b50 (diff)
Move module implementation from brep/ to mod/
Diffstat (limited to 'mod/options.cli')
-rw-r--r--mod/options.cli211
1 files changed, 211 insertions, 0 deletions
diff --git a/mod/options.cli b/mod/options.cli
new file mode 100644
index 0000000..ba8b37b
--- /dev/null
+++ b/mod/options.cli
@@ -0,0 +1,211 @@
+// file : mod/options.cli -*- C++ -*-
+// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+include <web/xhtml-fragment>;
+
+include <brep/types>;
+
+include <mod/options-types>;
+
+namespace brep
+{
+ // Web module configuration options.
+ //
+ namespace options
+ {
+ // Option groups.
+ //
+ class module
+ {
+ dir_path root = "/"
+ {
+ "<path>"
+ "Repository root. That is, this is the part of the URL between the
+ host name and the start of the repository. For example, root value
+ '\cb{/pkg}' means the repository URL is http://example.org/pkg/.
+ Specify '\cb{/}' to use the web server root (http://example.org/)."
+ }
+
+ uint16_t verbosity = 0
+ {
+ "<level>",
+ "Trace verbosity level. Level 0 disables tracing, which is also the
+ default."
+ }
+ };
+
+ class db
+ {
+ string db-user
+ {
+ "<user>",
+ "Database user name. If not specified, then operating system (login)
+ name is used."
+ }
+
+ string db-password
+ {
+ "<pass>",
+ "Database password. If not specified, then login without password is
+ expected to work."
+ }
+
+ string db-name = "brep"
+ {
+ "<name>",
+ "Database name. If not specified, then '\cb{brep}' is used by
+ default."
+ }
+
+ string db-host
+ {
+ "<host>",
+ "Database host name, address, or socket. If not specified, then
+ connect to \cb{localhost} using the operating system-default
+ mechanism (Unix-domain socket, etc)."
+ }
+
+ uint16_t db-port = 0
+ {
+ "<port>",
+ "Database port number. If not specified, the default port is used."
+ }
+
+ size_t db-max-connections = 5
+ {
+ "<num>",
+ "The maximum number of concurrent database connections per web server
+ process. If 0, then no limitation is applied. The default is 5."
+ }
+
+ size_t db-retry = 10
+ {
+ "<num>",
+ "The maximum number of times to retry database transactions in the
+ face of recoverable failures (deadlock, loss of connection, etc). The
+ default is 10."
+ }
+ };
+
+ class page
+ {
+ web::xhtml::fragment logo
+ {
+ "<xhtml>",
+ "Web page logo. It is displayed in the page header aligned to the left
+ edge. The value is treated as an XHTML5 fragment."
+ }
+
+ vector<page_menu> menu;
+ {
+ "<label=link>",
+ "Web page menu. Each entry is displayed in the page header in the
+ order specified and aligned to the right edge. A link target that
+ starts with '\cb{/}' or contains '\cb{:}' is used as is. Otherwise,
+ it is prefixed with the repository web interface root."
+ }
+ };
+
+ class search
+ {
+ uint16_t search-results = 10
+ {
+ "<num>",
+ "Number of results per page. The default is 10."
+ }
+
+ uint16_t search-pages = 5
+ {
+ "<num>",
+ "Number of pages in navigation (pager). The default is 5."
+ }
+ };
+
+ class package
+ {
+ uint16_t package-description = 500
+ {
+ "<len>",
+ "Number of package description characters to display in brief pages.
+ The default is 500 (~ 80 characters * 6 lines)."
+ }
+
+ uint16_t package-changes = 5000;
+ {
+ "<len>",
+ "Number of package changes characters to display in brief pages. The
+ default is 5000 (~ 80 chars x 60 lines)."
+ }
+ };
+
+ // Module options.
+ //
+ class package_search: search, db, page, module
+ {
+ };
+
+ class package_details: package, search, db, page, module
+ {
+ };
+
+ class package_version_details: package, db, page, module
+ {
+ };
+
+ class repository_details: db, page, module
+ {
+ };
+
+ class repository_root: module
+ {
+ };
+ }
+
+ // Web module HTTP request parameters.
+ //
+ namespace params
+ {
+ // Use parameters long names in the C++ code, short aliases (if present)
+ // in HTTP URL.
+ //
+ class package_search
+ {
+ // Display package search result list starting from this page.
+ //
+ uint16_t page | p;
+
+ // Package search criteria.
+ //
+ string query | q;
+ };
+
+ class package_details
+ {
+ // Display package version search result list starting from this page.
+ //
+ uint16_t page | p;
+
+ // Package version search criteria.
+ //
+ string query | q;
+
+ // Page form.
+ //
+ page_form form | f = page_form::brief;
+ };
+
+ class package_version_details
+ {
+ // Page form.
+ //
+ page_form form | f = page_form::brief;
+ };
+
+ class repository_details
+ {
+ // No parameters so far.
+ //
+ };
+ }
+}