wttr.in/cmd/config.go

42 lines
670 B
Go
Raw Normal View History

2022-11-19 18:19:42 +00:00
package main
// Config of the program.
type Config struct {
Logging
2022-11-19 18:34:11 +00:00
Server
2022-11-19 18:19:42 +00:00
}
// Logging configuration.
type Logging struct {
// AccessLog path.
AccessLog string
// Interval between access log flushes, in seconds.
Interval int
}
2022-11-19 18:34:11 +00:00
// 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
}
2022-11-19 18:19:42 +00:00
// Conf contains the current configuration.
var Conf = Config{
Logging{
AccessLog: "/wttr.in/log/access.log",
Interval: 300,
},
2022-11-19 18:34:11 +00:00
Server{
PortHTTP: 8083,
PortHTTPS: 0,
},
2022-11-19 18:19:42 +00:00
}