Brijesh's Git Server — watchman @ d8af78ff7ad2ae757e1fad592c3d3a9572479ced

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
}