mirror of https://github.com/chubin/wttr.in
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1004 B
54 lines
1004 B
2 years ago
|
package config
|
||
2 years ago
|
|
||
|
// Config of the program.
|
||
|
type Config struct {
|
||
|
Logging
|
||
2 years ago
|
Server
|
||
2 years ago
|
}
|
||
|
|
||
|
// Logging configuration.
|
||
|
type Logging struct {
|
||
|
|
||
|
// AccessLog path.
|
||
|
AccessLog string
|
||
|
|
||
2 years ago
|
// ErrorsLog path.
|
||
|
ErrorsLog string
|
||
|
|
||
2 years ago
|
// Interval between access log flushes, in seconds.
|
||
|
Interval int
|
||
|
}
|
||
|
|
||
2 years ago
|
// Server configuration.
|
||
|
type Server struct {
|
||
|
|
||
|
// PortHTTP is port where HTTP server must listen.
|
||
|
// If 0, HTTP is disabled.
|
||
|
PortHTTP int
|
||
|
|
||
|
// PortHTTP is port where the HTTPS server must listen.
|
||
|
// If 0, HTTPS is disabled.
|
||
|
PortHTTPS int
|
||
2 years ago
|
|
||
|
// TLSCertFile contains path to cert file for TLS Server.
|
||
|
TLSCertFile string
|
||
|
|
||
|
// TLSCertFile contains path to key file for TLS Server.
|
||
|
TLSKeyFile string
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
// Conf contains the current configuration.
|
||
|
var Conf = Config{
|
||
|
Logging{
|
||
|
AccessLog: "/wttr.in/log/access.log",
|
||
2 years ago
|
ErrorsLog: "/wttr.in/log/errors.log",
|
||
2 years ago
|
Interval: 300,
|
||
|
},
|
||
2 years ago
|
Server{
|
||
2 years ago
|
PortHTTP: 8083,
|
||
|
PortHTTPS: 8084,
|
||
|
TLSCertFile: "/wttr.in/etc/fullchain.pem",
|
||
|
TLSKeyFile: "/wttr.in/etc/privkey.pem",
|
||
2 years ago
|
},
|
||
2 years ago
|
}
|