This repository has been archived on 2025-09-28. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
ass/config.go

25 lines
433 B
Go
Raw Normal View History

2024-06-29 09:38:07 +02:00
package main
// Copyright (c) 2024 Julian Müller (ChaoticByte)
// License: MIT
import (
"log"
"os"
"github.com/goccy/go-yaml"
)
var config struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
Clients map[string]string `yaml:"clients"`
}
func ParseConfig(filepath string) {
data, err := os.ReadFile(filepath)
if err != nil { log.Fatal(err) }
err = yaml.Unmarshal(data, &config)
if err != nil { log.Fatal(err) }
}