wttr.in/internal/config/config.go
2022-11-29 21:38:39 +01:00

53 lines
1,004 B
Go

package config
// Config of the program.
type Config struct {
Logging
Server
}
// Logging configuration.
type Logging struct {
// AccessLog path.
AccessLog string
// ErrorsLog path.
ErrorsLog string
// Interval between access log flushes, in seconds.
Interval int
}
// 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
// TLSCertFile contains path to cert file for TLS Server.
TLSCertFile string
// TLSCertFile contains path to key file for TLS Server.
TLSKeyFile string
}
// Conf contains the current configuration.
var Conf = Config{
Logging{
AccessLog: "/wttr.in/log/access.log",
ErrorsLog: "/wttr.in/log/errors.log",
Interval: 300,
},
Server{
PortHTTP: 8083,
PortHTTPS: 8084,
TLSCertFile: "/wttr.in/etc/fullchain.pem",
TLSKeyFile: "/wttr.in/etc/privkey.pem",
},
}