4595ca4a5e
i have the program reaching out to the remote machine and creating the archive. however, it doesn't acutally grab the file and the program creates an empty archive.
32 lines
407 B
Go
32 lines
407 B
Go
package main
|
|
|
|
import (
|
|
"io/ioutil"
|
|
|
|
"gopkg.in/yaml.v2"
|
|
)
|
|
|
|
type Configuration struct {
|
|
Username string
|
|
Password string
|
|
Port int
|
|
Hosts []string
|
|
}
|
|
|
|
func initializeConfig(filename string) Configuration {
|
|
var config Configuration
|
|
source, err := ioutil.ReadFile(filename)
|
|
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
err = yaml.Unmarshal(source, &config)
|
|
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
return config
|
|
}
|