mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-22 08:40:03 +01:00
27 lines
489 B
Go
27 lines
489 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"github.com/fsnotify/fsnotify"
|
||
|
"github.com/spf13/viper"
|
||
|
)
|
||
|
|
||
|
func loadConfigs() {
|
||
|
viper.SetConfigName("configs")
|
||
|
viper.AddConfigPath("configs/")
|
||
|
|
||
|
viper.SetDefault("kafka.group_id", "livestream")
|
||
|
viper.SetDefault("prod", false)
|
||
|
|
||
|
err := viper.ReadInConfig()
|
||
|
if err != nil {
|
||
|
panic(fmt.Errorf("fatal error config file: %w", err))
|
||
|
}
|
||
|
|
||
|
viper.OnConfigChange(func(e fsnotify.Event) {
|
||
|
fmt.Println("Config file changed:", e.Name)
|
||
|
})
|
||
|
viper.WatchConfig()
|
||
|
}
|