aboutsummaryrefslogtreecommitdiff
path: root/brep/options.cli
blob: d5041c8ddea27a05fb023334e9d31e881a626aa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// file      : brep/options.cli -*- C++ -*-
// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

include <brep/types>;

include <brep/options-types>;

namespace brep
{
  // Web module configuration options.
  //
  namespace options
  {
    // Option groups.
    //
    class module
    {
      uint16_t log-verbosity;
      dir_path root = "/";
    };

    class db
    {
      string db-host = "localhost";
      uint16_t db-port = 5432;
    };

    class search
    {
      uint16_t search-results = 10;
      uint16_t pager-pages = 5;
    };

    class package
    {
      uint16_t description-len = 500; // ~ 80 chars x 6 lines.
      uint16_t changes-len = 5000; // ~ 80 chars x 60 lines.
    };

    // Module options.
    //
    class package_search: module, db, search
    {
    };

    class package_details: module, db, search, package
    {
    };

    class package_version_details: module, db, package
    {
    };

    class repository_details: module, db
    {
    };

    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.
      //
    };
  }
}