Brijesh's Git Server — watchman @ f57775c9d4697979ab959a360971d36dc91b178b

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
}