adds option structs, ready for Show implementation

This commit is contained in:
2021-05-15 13:49:34 -07:00
parent 7bedb452e4
commit 8a7c865b5f
5 changed files with 145 additions and 78 deletions

View File

@@ -46,9 +46,11 @@ import (
func main() {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
userMode := false
// Equivalent to `systemctl enable nginx` with a 10 second timeout
err := systemctl.Enable(ctx, "nginx", userMode)
opts := Options{
usermode: false,
}
err := Enable(ctx, unit, opts)
if err != nil {
log.Fatalf("unable to enable unit %s: %v", "nginx", err)
}