This commit is contained in:
2023-08-11 15:45:43 +02:00
parent e7cca80808
commit f707380387
3 changed files with 28 additions and 0 deletions

18
main.go
View File

@@ -3,10 +3,28 @@ package main
import "fmt"
import "net/http"
import "io"
import "io/ioutil"
import "log"
import "gopkg.in/yaml.v3"
type Group struct {
Name string `yaml:"group"`
Tables []string `yaml:"tables"`
Hosts []string `yaml:"hosts"`
}
func main() {
fmt.Println("staring")
var conf map[string]Group
yamlFile, err := ioutil.ReadFile("conf.yaml")
if err != nil {
log.Printf("Configuration open error #%v ", err)
}
err = yaml.Unmarshal(yamlFile, &conf)
if err != nil {
log.Fatalf("Configuration read error #%v", err)
}
resp, err := http.Head("http://example.com")
if err != nil {
fmt.Println("Failed")