start unmarshalling of config file

This commit is contained in:
Callan Bryant 2020-03-02 02:35:32 +00:00
parent e62f47dee0
commit 3cce9fa63e
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA

11
add.go
View File

@ -1,5 +1,14 @@
package dsnet
func Add(hostname string, owner string, description string, publicKey string) {
import (
"io/ioutil"
"encoding/json"
)
func Add(hostname string, owner string, description string, publicKey string) {
raw, err := ioutil.ReadFile(CONFIG_FILE)
check(err)
conf := DsnetConfig{}
err = json.Unmarshal(raw, &conf)
check(err)
}