Documentation
¶
Overview ¶
Package daemon runs the long-lived process that holds the WhatsApp connection. Only one process may use a session at a time, so every CLI command talks to it.
Index ¶
- func EnsureRunning(acct *config.Account, timeout time.Duration) error
- func Install(acct *config.Account) (string, error)
- func Installed(acct *config.Account) bool
- func Lock(path string) (func(), error)
- func Locked(path string) bool
- func Logger(acct *config.Account, foreground bool, debug bool) (zerolog.Logger, io.Closer, error)
- func PID(acct *config.Account) int
- func Restart(acct *config.Account, timeout time.Duration) error
- func Run(acct *config.Account, foreground, debug bool) error
- func Spawn(acct *config.Account) error
- func Stop(acct *config.Account, timeout time.Duration) (bool, error)
- func Uninstall(acct *config.Account) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Install ¶
Install registers a login service that keeps the daemon running and restarts it if it dies.
func Locked ¶
Locked reports whether a daemon (or an in-process command) currently owns the session.
func Logger ¶
Logger writes JSON logs to the account log file (and pretty logs to stderr in the foreground).
func Restart ¶
Restart stops whatever daemon holds the account (service-owned or not) and starts it again, through the login service when one is installed.
Types ¶
This section is empty.