jpictl: refactor zones loading

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-08-25 21:31:15 +01:00
parent 2043708949
commit 26c49dff72
3 changed files with 9 additions and 6 deletions
+7
View File
@@ -1,5 +1,7 @@
package main
import "git.jpi.io/amery/jpictl/pkg/zones"
// Config describes the repository
type Config struct {
Base string
@@ -10,3 +12,8 @@ var cfg = &Config{
Base: "./m",
Domain: "m.jpi.cloud",
}
// LoadZones loads all zones and machines in the config directory
func (cfg *Config) LoadZones() (*zones.Zones, error) {
return zones.New(cfg.Base, cfg.Domain)
}