aboutsummaryrefslogtreecommitdiff
path: root/brep/options.cli
blob: 90063c18cf6a419f83afaca4d7911d675d7d9e16 (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
// file      : brep/options.cli -*- C++ -*-
// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

include <string>;
include <cstdint>; // uint16_t

namespace brep
{
  // Web module configuration options.
  //
  namespace options
  {
    class module
    {
      std::uint16_t verb = 0;
    };

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

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

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

    class package_version_details: module, db
    {
    };
  }

  // Web module HTTP request parameters.
  //
  namespace params
  {
    // Use parameters long names in the C++ code, short aliases in HTTP URL.
    //
    class package_search
    {
      // Display package search result list starting from this page.
      //
      std::uint16_t page | p = 0;

      // Package search criteria.
      //
      std::string query | q = "";
    };

    class package_version_search
    {
      // Display package version search result list starting from this page.
      //
      std::uint16_t page | p = 0;

      // Package version search criteria.
      //
      std::string query | q = "";
    };

    class package_version_details
    {
    };
  }
}