client

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package client implements the local IPC client for kcdctl.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	SocketPath string
	Timeout    time.Duration
}

Client connects to the kcd daemon via Unix socket.

func (*Client) Battery

func (c *Client) Battery(deviceID string) (int, bool, error)

Battery queries the daemon for a device's battery state.

func (*Client) Call

func (c *Client) Call(cmd string, payload interface{}) (*ipc.Response, error)

Call dialed the daemon, sends a request, and returns the response.

func (*Client) CallMute

func (c *Client) CallMute(deviceID string) error

CallMute requests the daemon to mute an incoming call on the remote device.

func (*Client) ClipboardPush

func (c *Client) ClipboardPush(deviceID string) error

ClipboardPush triggers an outgoing clipboard sync from desktop to device.

func (*Client) Connect added in v1.0.1

func (c *Client) Connect(ip string) error

Connect requests the daemon to manually connect to a device by IP.

func (*Client) Devices

func (c *Client) Devices() ([]device.DeviceInfo, error)

Devices queries the daemon for all known devices.

func (*Client) FindMyPhone

func (c *Client) FindMyPhone(deviceID string) error

FindMyPhone requests the remote device to ring loudly.

func (*Client) Lock

func (c *Client) Lock(deviceID string) error

Lock requests the daemon to lock the session.

func (*Client) NotifyReply

func (c *Client) NotifyReply(deviceID, replyID, message string) error

NotifyReply requests the daemon to send a reply to an Android notification.

func (*Client) Pair

func (c *Client) Pair(deviceID string) error

Pair requests the daemon to pair with a specific device.

func (*Client) Ping

func (c *Client) Ping(deviceID string) error

Ping sends a ping packet to a specific device.

func (*Client) RunExec

func (c *Client) RunExec(deviceID string, key string) error

RunExec requests the remote device to execute a specific command key.

func (*Client) RunList

func (c *Client) RunList(deviceID string) error

RunList requests the remote device to send its command list.

func (*Client) SendSMS

func (c *Client) SendSMS(deviceID, phoneNumber, message string) error

SendSMS requests the remote device to send an SMS.

func (*Client) SftpMount

func (c *Client) SftpMount(deviceID string) error

SftpMount requests the daemon to initiate an SFTP connection to the remote device.

func (*Client) SftpMountLocal

func (c *Client) SftpMountLocal(deviceID string) error

SftpMountLocal requests the daemon to physically mount the remote device via sshfs.

func (*Client) ShareFile

func (c *Client) ShareFile(deviceID string, filePath string) error

ShareFile requests the daemon to send a local file to the remote device.

func (*Client) Unlock

func (c *Client) Unlock(deviceID string) error

Unlock requests the daemon to unlock the session.

func (*Client) Unpair

func (c *Client) Unpair(deviceID string) error

Unpair requests the daemon to unpair and forget a specific device.

func (*Client) Watch

func (c *Client) Watch(ctx context.Context, filter []string, ch chan<- events.Event) error

WatchFile subscribes to daemon events and streams them to the given channel.

Jump to

Keyboard shortcuts

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