Documentation
¶
Index ¶
- type RequestBody
- type RunCommandPlugin
- func (p *RunCommandPlugin) Handle(ctx context.Context, dev device.Sender, pkt *protocol.Packet) error
- func (p *RunCommandPlugin) IncomingTypes() []string
- func (p *RunCommandPlugin) Name() string
- func (p *RunCommandPlugin) OnConnect(dev device.Sender)
- func (p *RunCommandPlugin) OnDisconnect(dev device.Sender)
- func (p *RunCommandPlugin) OutgoingTypes() []string
- func (p *RunCommandPlugin) Timeout() time.Duration
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.
Click to show internal directories.
Click to hide internal directories.