Update `config.go` Add `feed.go` Add `messageTypes.go` Add `process.go` Update `main.go` Update `structures.go` Update `go.mod` Update `go.sum`
21 lines
415 B
Go
21 lines
415 B
Go
package config
|
|
|
|
import (
|
|
"github.com/rs/zerolog/log"
|
|
"os"
|
|
)
|
|
|
|
var (
|
|
RedisHostname = os.Getenv("TRAINS_REDIS_HOST")
|
|
RedisUsername = os.Getenv("TRAINS_REDIS_USER")
|
|
RedisPassword = os.Getenv("TRAINS_REDIS_PASS")
|
|
|
|
NationalRailUsername = os.Getenv("TRAINS_NR_USER")
|
|
NationalRailPassword = os.Getenv("TRAINS_NR_PASS")
|
|
)
|
|
|
|
func init() {
|
|
if len(RedisHostname) == 0 {
|
|
log.Fatal().Msg("empty TRAINS_REDIS_HOST")
|
|
}
|
|
}
|