(c *stdapi.Context)
| 794 | } |
| 795 | |
| 796 | func (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 | |
| 829 | func (s *Server) ProcessRun(c *stdapi.Context) error { |
| 830 | if err := s.hook("ProcessRunValidate", c); err != nil { |
nothing calls this directly
no test coverage detected