aboutsummaryrefslogtreecommitdiff
path: root/brep/options.cli
blob: fa05b56ab5a5367f58eb4ba6cae1c27279fdf01b (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
// 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
  {
    class module
    {
      uint16_t verb;
      dir_path root;
    };

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

    class package_search: module, db
    {
      uint16_t results-on-page = 10;
      uint16_t pages-in-pager = 5;
    };

    class package_details: module, db
    {
      uint16_t results-on-page = 10;
      uint16_t pages-in-pager = 5;
      uint16_t description-length = 500; // ~ 80 chars x 6 lines.
    };

    class package_version_details: module, db
    {
      uint16_t description-length = 500; // ~ 80 chars x 6 lines.
      uint16_t changes-length = 5000; // ~ 80 chars x 60 lines.
    };

    class repository_details: module, db
    {
    };
  }

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