aboutsummaryrefslogtreecommitdiffhomepage
path: root/msg.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-07-03 02:59:43 +0900
committerOphestra <cat@gensokyo.uk>2025-07-03 02:59:43 +0900
commit1b5ecd9eaf3289d164d8ed1bce6013e0e4ef8e86 (patch)
tree047fe5fabdfb37d5c0088f7f572cebc8b13853bb /msg.go
parent82561d62b66f17c05604e87f18187bb3a91f00d2 (diff)
container: move out of toplevel
This allows slightly easier use of the vanity url. This also provides some disambiguation between low level containers and hakurei app containers. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'msg.go')
-rw-r--r--msg.go43
1 files changed, 0 insertions, 43 deletions
diff --git a/msg.go b/msg.go
deleted file mode 100644
index aa7a272d..00000000
--- a/msg.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package hakurei
-
-import (
- "log"
- "sync/atomic"
-)
-
-type Msg interface {
- IsVerbose() bool
- Verbose(v ...any)
- Verbosef(format string, v ...any)
- WrapErr(err error, a ...any) error
- PrintBaseErr(err error, fallback string)
-
- Suspend()
- Resume() bool
-
- BeforeExit()
-}
-
-type DefaultMsg struct{ inactive atomic.Bool }
-
-func (msg *DefaultMsg) IsVerbose() bool { return true }
-func (msg *DefaultMsg) Verbose(v ...any) {
- if !msg.inactive.Load() {
- log.Println(v...)
- }
-}
-func (msg *DefaultMsg) Verbosef(format string, v ...any) {
- if !msg.inactive.Load() {
- log.Printf(format, v...)
- }
-}
-
-func (msg *DefaultMsg) WrapErr(err error, a ...any) error {
- log.Println(a...)
- return err
-}
-func (msg *DefaultMsg) PrintBaseErr(err error, fallback string) { log.Println(fallback, err) }
-
-func (msg *DefaultMsg) Suspend() { msg.inactive.Store(true) }
-func (msg *DefaultMsg) Resume() bool { return msg.inactive.CompareAndSwap(true, false) }
-func (msg *DefaultMsg) BeforeExit() {}