diff options
author | Julien Dessaux | 2024-03-07 00:54:35 +0100 |
---|---|---|
committer | Julien Dessaux | 2024-03-07 01:02:23 +0100 |
commit | 560becfd32dd7355547938f3c6229060dd395aab (patch) | |
tree | 42329f4e47c64349ae8a0205f867632ac52bcdc6 /pkg/gonf.go | |
parent | feat(stdlib): began adding systemd services support (diff) | |
download | gonf-560becfd32dd7355547938f3c6229060dd395aab.tar.gz gonf-560becfd32dd7355547938f3c6229060dd395aab.tar.bz2 gonf-560becfd32dd7355547938f3c6229060dd395aab.zip |
chore(repo): renamed gonf subfolder to something more traditional in go land
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 + } +} |