Documentation
¶
Overview ¶
Package signalcli adapts the Signal messenger to the inbox Source and Sink ports by speaking JSON-RPC to a signal-cli daemon. signal-cli runs as a separate, operator-supplied process (it links to an existing Signal account as a secondary device, so no separate phone number is needed) and exposes a newline-delimited JSON-RPC interface on a loopback TCP port. This package is a pure-Go client over that socket: it never embeds signal-cli and dials only the loopback daemon.
Incoming messages arrive as JSON-RPC "receive" notifications and are emitted as inbox entries; replies are sent with the "send" method. Each request carries a unique id and the client awaits the matching response before returning, so a reply is correlated to its call and a send is never lost behind another.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Signal source and sink backed by a signal-cli JSON-RPC daemon. Construct it with New.
func New ¶
New builds a Signal client that talks to the signal-cli JSON-RPC daemon at the given loopback TCP address (for example 127.0.0.1:7583).
func (*Client) Receive ¶
Receive connects to the daemon and streams each incoming text message as an inbox.Spec until ctx is cancelled, reconnecting after a dropped connection. The returned channel is closed when ctx is cancelled. The Spec's Source is left for the ingester to stamp.
type Option ¶
type Option func(*Client)
Option configures a Client.
func WithAccount ¶
WithAccount sets the Signal account (the linked +number) to act as, required only when the daemon serves multiple accounts. Single-account daemons need none.