Brijesh's Git Server — watchman @ c4703486eca9ca9390314db3e85650a3cb6457d9

observability tool, needs to be rewritten once identity is stable

utils/config.go (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
package utils

import (
	"fmt"
	"os"
	"watchman/schema"

	"gopkg.in/yaml.v3"
)

func Read_Config() schema.ConfigType {
	var Config schema.ConfigType

	yamlFile, err := os.ReadFile("config.yaml")
	if err != nil {
		fmt.Println(err)
	}

	err = yaml.Unmarshal(yamlFile, &Config)
	if err != nil {
		fmt.Println(err)
	}

	return Config
}