forked from emersion/neutron
/
config.go
54 lines (43 loc) · 845 Bytes
/
config.go
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
// Parses the configuration file.
package config
import (
"github.com/emersion/neutron/backend/imap"
"github.com/emersion/neutron/backend/smtp"
"github.com/emersion/neutron/backend/disk"
)
// Configuration for all backends.
// Backends omitted or set to null won't be activated.
type Config struct {
// Memory config.
Memory *MemoryConfig
// IMAP config.
Imap *ImapConfig
// SMTP config.
Smtp *SmtpConfig
// Disk config.
Disk *DiskConfig
}
type BackendConfig struct {
Enabled bool
}
type MemoryConfig struct {
*BackendConfig
Populate bool
Domains []string
}
type ImapConfig struct {
*BackendConfig
*imap.Config
}
type SmtpConfig struct {
*BackendConfig
*smtp.Config
}
type DiskConfig struct {
*BackendConfig
*disk.Config
Contacts *DiskConfig
Keys *DiskConfig
UsersSettings *DiskConfig
Addresses *DiskConfig
}