-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
51 lines (45 loc) · 1.09 KB
/
types.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
package main
import "github.com/jackc/pgx/v5/pgtype"
// TomlConfig is the structure for holding the application configuration
type TomlConfig struct {
Paths PathInfo
Pg PGInfo
Server ServerInfo
TLS TLSInfo
}
type PathInfo struct {
BaseDir string // Location of the git source
DataDir string // Directory where the downloads are located
}
type PGInfo struct {
Database string
NumConnections int `toml:"num_connections"`
Port int
Password string
Server string
SSL bool
Username string
}
type ServerInfo struct {
Debug bool
Port int
SSLPort int
}
type TLSInfo struct {
CertFile string // Full path of the TLS certificate file
KeyFile string // Full path of the TLS private key file
}
// dbEntry is used for storing the new database entries
type dbEntry struct {
ipv4 pgtype.Text
ipv6 pgtype.Text
ipstrange pgtype.Text
port pgtype.Int4
}
// RecordDownloads are used to determine where downloads are recorded
type RecordDownloads int
const (
RECORD_IN_PG RecordDownloads = iota
RECORD_IN_SQLITE
RECORD_NOWHERE
)