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

Method AppLogs

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

Source from the content-addressed store, hash-verified

103}
104
105func (s *Server) AppLogs(c *stdapi.Context) error {
106 if err := s.hook("AppLogsValidate", c); err != nil {
107 return err
108 }
109
110 name := c.Var("name")
111
112 var opts structs.LogsOptions
113 if err := stdapi.UnmarshalOptions(c.Request(), &opts); err != nil {
114 return err
115 }
116
117 v, err := s.provider(c).WithContext(c.Context()).AppLogs(name, opts)
118 if err != nil {
119 return err
120 }
121
122 if c, ok := interface{}(v).(io.Closer); ok {
123 defer c.Close()
124 }
125
126 if _, err := io.Copy(c, v); err != nil {
127 return err
128 }
129
130 if vs, ok := interface{}(v).(Sortable); ok {
131 sort.Slice(v, vs.Less)
132 }
133
134 return nil
135}
136
137func (s *Server) AppMetrics(c *stdapi.Context) error {
138 if err := s.hook("AppMetricsValidate", 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
AppLogsMethod · 0.65
WithContextMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected