Documentation
¶
Overview ¶
Package ipc defines the local Unix socket protocol used between the daemon and the command line interface.
Index ¶
Constants ¶
const ( CmdDevices = "devices" CmdPair = "pair" CmdUnpair = "unpair" CmdPing = "ping" CmdBattery = "battery" CmdClipboardPush = "clipboard_push" CmdRunList = "run_list" CmdRunExec = "run_exec" CmdWatch = "watch" CmdSftpMount = "sftp_mount" CmdNotifyReply = "notify_reply" CmdCallMute = "call_mute" CmdFindMyPhone = "findmyphone" CmdLock = "lock" CmdUnlock = "unlock" CmdSendSMS = "send_sms" CmdSftpMountLocal = "sftp_mount_local" )
Supported IPC command constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DevicePayload ¶
DevicePayload is sent in requests requiring a device ID (like pair/unpair/ping).
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles incoming IPC requests.
func NewHandler ¶
func NewHandler(devices *device.Registry, plugins *plugin.Registry, pairPlugin *pair.PairPlugin, statePath string, bus *events.Bus) *Handler
NewHandler creates a new IPC command handler.
func (*Handler) HandleRequest ¶
HandleRequest processes an incoming IPC request and returns a response.
type NotifyReplyPayload ¶
type NotifyReplyPayload struct {
DeviceID string `json:"deviceId"`
ReplyID string `json:"replyId"`
Message string `json:"message"`
}
NotifyReplyPayload is used for CmdNotifyReply.
type Request ¶
type Request struct {
Command string `json:"cmd"`
Payload json.RawMessage `json:"payload,omitempty"`
}
Request is sent from the client to the local daemon.
type Response ¶
type Response struct {
OK bool `json:"ok"`
Error string `json:"error,omitempty"`
Data json.RawMessage `json:"data,omitempty"`
}
Response is sent from the daemon back to the client.
type SMSPayload ¶
type SMSPayload struct {
DeviceID string `json:"deviceId"`
PhoneNumber string `json:"phoneNumber"`
Message string `json:"message"`
}
SMSPayload is used for CmdSendSMS.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server handles listening for JSON IPC requests over a Unix socket.
type SftpMountLocalPayload ¶
type SftpMountLocalPayload struct {
DeviceID string `json:"deviceId"`
}
SftpMountLocalPayload is used for CmdSftpMountLocal.
type WatchPayload ¶
type WatchPayload struct {
Events []string `json:"events,omitempty"`
}
WatchPayload is used for CmdWatch to configure event streaming.