runcommand

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestBody

type RequestBody struct {
	RequestCommandList bool   `json:"requestCommandList,omitempty"`
	Key                string `json:"key,omitempty"`
}

RequestBody represents a request from the phone.

type RunCommandPlugin

type RunCommandPlugin struct {
	// Commands maps keys to shell command strings.
	Commands map[string]string
	// contains filtered or unexported fields
}

RunCommandPlugin allows remote devices to trigger pre-configured local commands.

func NewRunCommandPlugin

func NewRunCommandPlugin(commands map[string]string, logger *zap.Logger) *RunCommandPlugin

func (*RunCommandPlugin) Handle

func (p *RunCommandPlugin) Handle(ctx context.Context, dev device.Sender, pkt *protocol.Packet) error

Handle processes incoming command requests.

func (*RunCommandPlugin) IncomingTypes

func (p *RunCommandPlugin) IncomingTypes() []string

IncomingTypes returns the packet types this plugin handles.

func (*RunCommandPlugin) Name

func (p *RunCommandPlugin) Name() string

Name returns the plugin name.

func (*RunCommandPlugin) OnConnect

func (p *RunCommandPlugin) OnConnect(dev device.Sender)

func (*RunCommandPlugin) OnDisconnect

func (p *RunCommandPlugin) OnDisconnect(dev device.Sender)

func (*RunCommandPlugin) OutgoingTypes

func (p *RunCommandPlugin) OutgoingTypes() []string

OutgoingTypes returns the packet types this plugin may send.

func (*RunCommandPlugin) Timeout

func (p *RunCommandPlugin) Timeout() time.Duration

Timeout returns the timeout.

Jump to

Keyboard shortcuts

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