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

Method ProcessLogs

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

Source from the content-addressed store, hash-verified

794}
795
796func (s *Server) ProcessLogs(c *stdapi.Context) error {
797 if err := s.hook("ProcessLogsValidate", c); err != nil {
798 return err
799 }
800
801 app := c.Var("app")
802 pid := c.Var("pid")
803
804 var opts structs.LogsOptions
805 if err := stdapi.UnmarshalOptions(c.Request(), &opts); err != nil {
806 return err
807 }
808
809 v, err := s.provider(c).WithContext(c.Context()).ProcessLogs(app, pid, opts)
810 if err != nil {
811 return err
812 }
813
814 if c, ok := interface{}(v).(io.Closer); ok {
815 defer c.Close()
816 }
817
818 if _, err := io.Copy(c, v); err != nil {
819 return err
820 }
821
822 if vs, ok := interface{}(v).(Sortable); ok {
823 sort.Slice(v, vs.Less)
824 }
825
826 return nil
827}
828
829func (s *Server) ProcessRun(c *stdapi.Context) error {
830 if err := s.hook("ProcessRunValidate", c); err != nil {

Callers

nothing calls this directly

Calls 8

hookMethod · 0.95
providerMethod · 0.95
RequestMethod · 0.80
ContextMethod · 0.80
SliceMethod · 0.80
ProcessLogsMethod · 0.65
WithContextMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected