MCPcopy Create free account
hub / github.com/convox/rack / ProcessExec

Method ProcessExec

pkg/api/controllers.go:726–750  ·  view source on GitHub ↗
(c *stdapi.Context)

Source from the content-addressed store, hash-verified

724}
725
726func (s *Server) ProcessExec(c *stdapi.Context) error {
727 if err := s.hook("ProcessExecValidate", c); err != nil {
728 return err
729 }
730
731 app := c.Var("app")
732 pid := c.Var("pid")
733 command := c.Value("command")
734
735 var opts structs.ProcessExecOptions
736 if err := stdapi.UnmarshalOptions(c.Request(), &opts); err != nil {
737 return err
738 }
739
740 v, err := s.provider(c).WithContext(c.Context()).ProcessExec(app, pid, command, stdsdk.NewAdapterWs(c.Websocket()), opts)
741 if err != nil {
742 return err
743 }
744
745 if vs, ok := interface{}(v).(Sortable); ok {
746 sort.Slice(v, vs.Less)
747 }
748
749 return renderStatusCode(c, v)
750}
751
752func (s *Server) ProcessGet(c *stdapi.Context) error {
753 if err := s.hook("ProcessGetValidate", c); err != nil {

Callers

nothing calls this directly

Calls 9

hookMethod · 0.95
providerMethod · 0.95
renderStatusCodeFunction · 0.85
RequestMethod · 0.80
ContextMethod · 0.80
WebsocketMethod · 0.80
SliceMethod · 0.80
ProcessExecMethod · 0.65
WithContextMethod · 0.65

Tested by

no test coverage detected