diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-09-29 02:33:10 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-09-29 06:11:47 +0900 |
| commit | 46cd3a28c83e93b5d66c52d06a8366c11910d5c0 (patch) | |
| tree | 6e25c5078b5cd9de78b7a6c9b253f1132358812b /internal/app/dispatcher.go | |
| parent | ad1bc6794f0053c3e63eab408a0d530d53e8b51c (diff) | |
container: remove global msg
This frees all container instances of side effects.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/dispatcher.go')
| -rw-r--r-- | internal/app/dispatcher.go | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/internal/app/dispatcher.go b/internal/app/dispatcher.go index deecfa92..8ab60734 100644 --- a/internal/app/dispatcher.go +++ b/internal/app/dispatcher.go @@ -9,7 +9,6 @@ import ( "hakurei.app/container" "hakurei.app/internal" - "hakurei.app/internal/hlog" ) // syscallDispatcher provides methods that make state-dependent system calls as part of their behaviour. @@ -45,19 +44,15 @@ type syscallDispatcher interface { cmdOutput(cmd *exec.Cmd) ([]byte, error) // overflowUid provides [container.OverflowUid]. - overflowUid() int + overflowUid(msg container.Msg) int // overflowGid provides [container.OverflowGid]. - overflowGid() int + overflowGid(msg container.Msg) int // mustHsuPath provides [internal.MustHsuPath]. - mustHsuPath() string + mustHsuPath() *container.Absolute // fatalf provides [log.Fatalf]. fatalf(format string, v ...any) - - isVerbose() bool - verbose(v ...any) - verbosef(format string, v ...any) } // direct implements syscallDispatcher on the current kernel. @@ -87,13 +82,9 @@ func (direct) lookupGroupId(name string) (gid string, err error) { func (direct) cmdOutput(cmd *exec.Cmd) ([]byte, error) { return cmd.Output() } -func (direct) overflowUid() int { return container.OverflowUid() } -func (direct) overflowGid() int { return container.OverflowGid() } +func (direct) overflowUid(msg container.Msg) int { return container.OverflowUid(msg) } +func (direct) overflowGid(msg container.Msg) int { return container.OverflowGid(msg) } -func (direct) mustHsuPath() string { return internal.MustHsuPath() } +func (direct) mustHsuPath() *container.Absolute { return internal.MustHsuPath() } func (direct) fatalf(format string, v ...any) { log.Fatalf(format, v...) } - -func (k direct) isVerbose() bool { return hlog.Load() } -func (direct) verbose(v ...any) { hlog.Verbose(v...) } -func (direct) verbosef(format string, v ...any) { hlog.Verbosef(format, v...) } |
