Imported Upstream version 1.7.0
[platform/upstream/augeas.git] / lenses / pgbouncer.aug
1 (*
2 Module: Pgbouncer
3  Parses Pgbouncer ini configuration files.
4
5 Author: Andrew Colin Kissa <andrew@topdog.za.net>
6  Baruwa Enterprise Edition http://www.baruwa.com
7
8 About: License
9  This file is licensed under the LGPL v2+.
10
11 About: Configuration files
12  This lens applies to /etc/pgbouncer.ini See <filter>.
13
14 About: TODO
15  Create a tree for the database options
16 *)
17
18 module Pgbouncer =
19 autoload xfm
20
21 (************************************************************************
22  * Group:                 USEFUL PRIMITIVES
23  ************************************************************************)
24
25 let comment  = IniFile.comment IniFile.comment_re IniFile.comment_default
26
27 let sep = IniFile.sep "=" "="
28
29 let eol = Util.eol
30
31 let entry_re = ( /[A-Za-z][:#A-Za-z0-9._-]+|\*/)
32
33 (************************************************************************
34  * Group:                       ENTRY
35  *************************************************************************)
36
37 let non_db_line = [ key entry_re . sep . IniFile.sto_to_eol? . eol ]
38
39 let entry = non_db_line|comment
40
41 let title   = IniFile.title IniFile.record_re
42
43 let record  = IniFile.record title entry
44
45 (******************************************************************
46  * Group:                   LENS AND FILTER
47  ******************************************************************)
48
49 let lns = IniFile.lns record comment
50
51 (* Variable: filter *)
52 let filter = incl "/etc/pgbouncer.ini"
53
54 let xfm = transform lns filter
55