diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-09-29 06:32:15 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-09-29 06:34:29 +0900 |
| commit | 44ba7a5f02b7575a706a22aac53c8ac608d18f23 (patch) | |
| tree | c08890b09a42c38bdf24b976421704ce83a74fad /system/system.go | |
| parent | dc467493d8a1461ea321ccf5ca3a2b037f880088 (diff) | |
hst/enablement: move bits from system
This is part of the hst API, should not be in the implementation package.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'system/system.go')
| -rw-r--r-- | system/system.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/system/system.go b/system/system.go index 0d16a14a..5599218e 100644 --- a/system/system.go +++ b/system/system.go @@ -7,11 +7,12 @@ import ( "strings" "hakurei.app/container" + "hakurei.app/hst" ) const ( // User type is reverted at final instance exit. - User = EM << iota + User = hst.EM << iota // Process type is unconditionally reverted on exit. Process @@ -19,21 +20,21 @@ const ( ) // Criteria specifies types of Op to revert. -type Criteria Enablement +type Criteria hst.Enablement -func (ec *Criteria) hasType(t Enablement) bool { +func (ec *Criteria) hasType(t hst.Enablement) bool { // nil criteria: revert everything except User if ec == nil { return t != User } - return Enablement(*ec)&t != 0 + return hst.Enablement(*ec)&t != 0 } // Op is a reversible system operation. type Op interface { // Type returns [Op]'s enablement type, for matching a revert criteria. - Type() Enablement + Type() hst.Enablement apply(sys *I) error revert(sys *I, ec *Criteria) error @@ -44,7 +45,7 @@ type Op interface { } // TypeString extends [Enablement.String] to support [User] and [Process]. -func TypeString(e Enablement) string { +func TypeString(e hst.Enablement) string { switch e { case User: return "user" |
