daemon

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureRunning

func EnsureRunning(acct *config.Account, timeout time.Duration) error

func Install

func Install(acct *config.Account) (string, error)

Install registers a login service that keeps the daemon running and restarts it if it dies.

func Installed

func Installed(acct *config.Account) bool

Installed reports whether a login service file exists.

func Lock

func Lock(path string) (func(), error)

Lock takes the session lock for in-process use (when no daemon runs).

func Locked

func Locked(path string) bool

Locked reports whether a daemon (or an in-process command) currently owns the session.

func Logger

func Logger(acct *config.Account, foreground bool, debug bool) (zerolog.Logger, io.Closer, error)

Logger writes JSON logs to the account log file (and pretty logs to stderr in the foreground).

func PID

func PID(acct *config.Account) int

PID returns the daemon's process ID if it's alive.

func Restart

func Restart(acct *config.Account, timeout time.Duration) error

Restart stops whatever daemon holds the account (service-owned or not) and starts it again, through the login service when one is installed.

func Run

func Run(acct *config.Account, foreground, debug bool) error

Run holds the connection until SIGINT/SIGTERM or `wassup daemon stop`.

func Spawn

func Spawn(acct *config.Account) error

Spawn starts a detached daemon process.

func Stop

func Stop(acct *config.Account, timeout time.Duration) (bool, error)

Stop asks the daemon to exit and waits for it.

func Uninstall

func Uninstall(acct *config.Account) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL