diff options
Diffstat (limited to 'pkg/gonf.go')
-rw-r--r-- | pkg/gonf.go | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/pkg/gonf.go b/pkg/gonf.go new file mode 100644 index 0000000..363a227 --- /dev/null +++ b/pkg/gonf.go @@ -0,0 +1,52 @@ +package gonf + +import ( + "log/slog" + "os" +) + +func EnableDebugLogs() { + h := slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{ + Level: slog.LevelDebug, + }) + slog.SetDefault(slog.New(h)) +} + +func Resolve() (status Status) { + for { + // ----- Files ------------------------------------------------- + status = resolveFiles() + switch status { + case BROKEN: + return BROKEN + case REPAIRED: + continue + } + // ----- Packages ---------------------------------------------- + status = resolvePackages() + switch status { + case BROKEN: + return BROKEN + case REPAIRED: + packages_list_function() + continue + } + // ----- Services ---------------------------------------------- + status = resolveServices() + switch status { + case BROKEN: + return BROKEN + case REPAIRED: + continue + } + // ----- Commands ---------------------------------------------- + status = resolveCommands() + switch status { + case BROKEN: + return BROKEN + case REPAIRED: + continue + } + return + } +} |