-
Notifications
You must be signed in to change notification settings - Fork 1
module platform
devlikebear edited this page Mar 19, 2026
·
1 revision
Go build tag를 사용하여 macOS 전용 기능과 스텁을 분리.
internal/<package>/
├── <name>.go # interface 정의
├── <name>_darwin.go # //go:build darwin — macOS 구현
└── <name>_stub.go # //go:build !darwin — noop 스텁
-
interface:
Detector.IdleSeconds() int -
darwin:
ioreg -c IOHIDSystem -d 4실행 →HIDIdleTime나노초 파싱 → 초 변환 - stub: 항상 0 반환
-
interface:
Notifier.Send(title, message, sound) error -
darwin:
osascript -e 'display notification "msg" with title "title" sound name "sound"' - stub: noop
-
interface:
Speaker.Speak(voice, message) error+Available(voice) bool -
darwin:
say -v <voice> "<message>". Available은say -v ?출력에서 검색. - stub: noop
-
breakscreen.go: 오케스트레이션 — mode에 따라 overlay/notification 분기 -
overlay_darwin.go: Swift BreakScreenApp 헬퍼를exec.Command로 실행 -
overlay_stub.go: 알림 폴백 -
ask_darwin.go:osascript다이얼로그로 block/notify 선택 -
helper.go:FindHelper(name)— 실행 파일 옆, bin/, ~/.local/bin/, PATH 순으로 검색