MCPcopy Create free account
hub / github.com/pydio/cells / sendCommand

Method sendCommand

cmd/ctl.go:488–508  ·  view source on GitHub ↗
(ctx context.Context, cmdName, itemName string)

Source from the content-addressed store, hash-verified

486}
487
488func (m *model) sendCommand(ctx context.Context, cmdName, itemName string) {
489 if m.br == nil {
490 if er := m.lazyBroker(ctx); er != nil {
491 m.title.SetText("Cannot connect to broker! No action performed")
492 return
493 }
494 }
495 e := m.br.PublishRaw(ctx, common.TopicRegistryCommand, []byte("cmd"), map[string]string{
496 "command": cmdName,
497 "itemName": itemName,
498 })
499 if e != nil {
500 m.title.SetText("Cannot publish command: " + e.Error())
501 }
502 go func() {
503 <-time.After(2 * time.Second)
504 m.app.QueueUpdateDraw(func() {
505 m.loadItems(m.getCurrentItem().ri, m.typeOpts(m.types[m.currentType])...)
506 })
507 }()
508}
509
510func (m *model) LsofLines(args []string) (map[string][]string, error) {
511 // Some systems (Arch, Debian) install lsof in /usr/bin and others (centos)

Callers 1

renderButtonsMethod · 0.95

Calls 6

lazyBrokerMethod · 0.95
loadItemsMethod · 0.95
getCurrentItemMethod · 0.95
typeOptsMethod · 0.95
PublishRawMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected