Documentation
¶
Overview ¶
Package sync converts libgm events into store rows. The Pump is meant to be registered as an EventHandler on gm.Client. All persistence work runs inline on the libgm callback goroutine — SQLite writes against a local file are fast enough that this hasn't been measured to be a bottleneck. If it ever becomes one, swap Handle for a buffered-channel pump without changing the public interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrLoggedOut = errors.New("phone reports logged-out state; re-run `gmcli auth`")
ErrLoggedOut signals that the phone no longer recognizes this pairing. Consumers should stop hammering the relay and direct the user to `gmcli auth` instead of treating it as a transient failure.
Functions ¶
func ConversationRow ¶
func ConversationRow(c *gmproto.Conversation, platform string) (store.Conversation, bool)
ConversationRow converts a libgm conversation proto into the store row shape. Returns ok=false when the proto has no conversation ID. Exported so the RPC event broadcaster can emit the same shape the store persists.
func MessageRow ¶
MessageRow converts a wrapped libgm message into the store row shape. Returns ok=false when the proto has no message ID. Exported so the RPC event broadcaster can emit the same shape the store persists.
Types ¶
type Pump ¶
type Pump struct {
// contains filtered or unexported fields
}
Pump owns the conversion of libgm events into store writes.
func (*Pump) Fatal ¶
Fatal returns a channel that receives terminal connection/auth errors. Long-running commands should select on this and exit non-zero so supervisors can restart or alert instead of silently idling after libgm gives up.
func (*Pump) Handle ¶
Handle is the entry point registered with gm.Client.Subscribe. It must not block; errors are logged but do not propagate.
func (*Pump) ImportContacts ¶
ImportContacts persists a full contact-list response from libgm.