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

Method BuildLogs

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

Source from the content-addressed store, hash-verified

285}
286
287func (s *Server) BuildLogs(c *stdapi.Context) error {
288 if err := s.hook("BuildLogsValidate", c); err != nil {
289 return err
290 }
291
292 app := c.Var("app")
293 id := c.Var("id")
294
295 var opts structs.LogsOptions
296 if err := stdapi.UnmarshalOptions(c.Request(), &opts); err != nil {
297 return err
298 }
299
300 v, err := s.provider(c).WithContext(c.Context()).BuildLogs(app, id, opts)
301 if err != nil {
302 return err
303 }
304
305 if c, ok := interface{}(v).(io.Closer); ok {
306 defer c.Close()
307 }
308
309 if _, err := io.Copy(c, v); err != nil {
310 return err
311 }
312
313 if vs, ok := interface{}(v).(Sortable); ok {
314 sort.Slice(v, vs.Less)
315 }
316
317 return nil
318}
319
320func (s *Server) BuildUpdate(c *stdapi.Context) error {
321 if err := s.hook("BuildUpdateValidate", 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
BuildLogsMethod · 0.65
WithContextMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected