Documentation
¶
Overview ¶
Package ipc defines the local Unix socket protocol used between the daemon and the command line interface.
Index ¶
- Constants
- type ConnectPayload
- type DevicePayload
- type Handler
- type MprisPlayerInfo
- type MprisStatusResponse
- type NotifyReplyPayload
- type PairListenResult
- type Request
- type Response
- type SMSPayload
- type Server
- type SftpInfoResponse
- type SharePayload
- type StatusResponse
- type StorageVolumeResponse
- type WatchPayload
Constants ¶
const ( CmdDevices = "devices" CmdPair = "pair" CmdPairListen = "pair_listen" CmdUnpair = "unpair" CmdPing = "ping" CmdBattery = "battery" CmdClipboardPush = "clipboard_push" CmdRunList = "run_list" CmdRunExec = "run_exec" CmdConnect = "connect" CmdBroadcastStart = "broadcast_start" CmdBroadcastStop = "broadcast_stop" CmdWatch = "watch" CmdSftpMount = "sftp_mount" CmdSftpInfo = "sftp_info" CmdSftpVolumes = "sftp_volumes" CmdNotifyReply = "notify_reply" CmdCallMute = "call_mute" CmdFindMyPhone = "findmyphone" CmdLock = "lock" CmdUnlock = "unlock" CmdSendSMS = "send_sms" CmdSftpMountLocal = "sftp_mount_local" CmdSftpUnmount = "sftp_unmount" CmdStatus = "status" CmdMprisStatus = "mpris_status" )
Supported IPC command constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectPayload ¶ added in v1.0.1
type ConnectPayload struct {
IP string `json:"ip"`
}
ConnectPayload carries the target IP for the CmdConnect command.
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 MprisPlayerInfo ¶ added in v1.10.0
type MprisPlayerInfo struct {
DisplayName string `json:"displayName"`
BusName string `json:"busName"`
ShortName string `json:"shortName"`
Title string `json:"title"`
Artist string `json:"artist"`
Album string `json:"album"`
PlaybackStatus string `json:"playbackStatus"`
IsPlaying bool `json:"isPlaying"`
Volume int `json:"volume"`
Pos int64 `json:"pos"`
Length int64 `json:"length"`
AlbumArtUrl string `json:"albumArtUrl"`
CanSeek bool `json:"canSeek"`
CanGoNext bool `json:"canGoNext"`
CanGoPrevious bool `json:"canGoPrevious"`
CanPlay bool `json:"canPlay"`
CanPause bool `json:"canPause"`
Error string `json:"error,omitempty"`
}
type MprisStatusResponse ¶ added in v1.10.0
type MprisStatusResponse struct {
WatcherRunning bool `json:"watcherRunning"`
DeviceCount int `json:"deviceCount"`
Players []MprisPlayerInfo `json:"players"`
PlayerMappings map[string]string `json:"playerMappings"`
}
type NotifyReplyPayload ¶
type NotifyReplyPayload struct {
DeviceID string `json:"deviceId"`
ReplyID string `json:"replyId"`
Message string `json:"message"`
}
NotifyReplyPayload is used for CmdNotifyReply.
type PairListenResult ¶ added in v1.10.0
type PairListenResult struct {
DeviceID string `json:"deviceId"`
DeviceName string `json:"deviceName"`
VerificationKey string `json:"verificationKey,omitempty"`
}
PairListenResult is returned by CmdPairListen on success.
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 SftpInfoResponse ¶ added in v1.10.0
type SftpInfoResponse struct {
IP string `json:"ip"`
Port json.Number `json:"port"`
User string `json:"user"`
Password string `json:"password"`
Path string `json:"path"`
Volumes []StorageVolumeResponse `json:"volumes,omitempty"`
}
SftpInfoResponse carries cached SFTP connection details returned by CmdSftpInfo.
type StatusResponse ¶ added in v1.0.5
type StatusResponse struct {
Version string `json:"version"`
StartedAt string `json:"startedAt"`
UptimeHuman string `json:"uptimeHuman"`
SocketPath string `json:"socketPath"`
ConfigPath string `json:"configPath"`
Plugins []string `json:"plugins"`
DeviceCount int `json:"deviceCount"`
ConnectedCount int `json:"connectedCount"`
}
StatusResponse is returned by CmdStatus.
type StorageVolumeResponse ¶ added in v1.10.0
StorageVolumeResponse describes a single browsable storage root on a device.
type WatchPayload ¶
type WatchPayload struct {
Events []string `json:"events,omitempty"`
}
WatchPayload is used for CmdWatch to configure event streaming.