aboutsummaryrefslogtreecommitdiff
path: root/brep/options.cli
blob: 8062f59fe56f9efcd53e76a8382233598ac4a47c (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
// 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;
    };

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

  // 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 = "";
    };
  }
}