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
use crate::config::{Address, Password};
use crate::section::BackendModifier;

#[derive(Debug)]
pub enum Line {
    Server {
        name: String,
        addr: Address,
        option: Option<String>,
        comment: Option<String>,
    },
    Option {
        keyword: String,
        value: Option<String>,
        comment: Option<String>,
    },
    Bind {
        addr: Address,
        value: Option<String>,
        comment: Option<String>,
    },
    Acl {
        name: String,
        rule: Option<String>,
        comment: Option<String>,
    },
    Backend {
        name: String,
        modifier: Option<BackendModifier>,
        condition: Option<String>,
        comment: Option<String>,
    },
    /// This usually refers to a haproxy user group however if it is in the global section of a
    /// config it is the systemuser haproxy will try to run as after starting up.
    Group {
        name: String,
        users: Vec<String>,
        comment: Option<String>,
    },
    User {
        name: String,
        password: Password,
        groups: Vec<String>,
        comment: Option<String>,
    },
    /// A global paramater describing the system user haproxy should run as
    SysUser {
        name: String,
    },
    Config {
        key: String,
        value: Option<String>,
        comment: Option<String>,
    },
    Comment(String),
    Blank,
}