Brijesh's Git Server — watchman @ 2960f2fd873b37cded9c2d861c37f90e0c3f08e6

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
}