-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
46 lines (40 loc) · 1.19 KB
/
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
package solidproxy
const (
// ServerVersion is used to display the server version number during HTTP requests
ServerVersion = "v2.1.3"
// ServerName is used to display the server name during HTTP requests
ServerName = "SolidProxy"
)
// ServerConfig contains all the configuration parameters for the proxy server
type ServerConfig struct {
Verbose bool
InsecureSkipVerify bool
Version string
Agent string
EnableTLS bool
TLSKey string
TLSCert string
Port string
}
// NewServerConfig creates a new ServerConfig object with a few default settings
func NewServerConfig() *ServerConfig {
return &ServerConfig{
Verbose: false,
InsecureSkipVerify: false,
Port: "3129",
EnableTLS: false,
Version: ServerVersion,
}
}
// GetServerVersion returns the current server version
func GetServerVersion() string {
return ServerVersion
}
// GetServerName returns the current server name
func GetServerName() string {
return ServerName
}
// GetServerFullName returns the concatenated server name and version
func GetServerFullName() string {
return ServerName + "-" + ServerVersion
}