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

Method BuildUpdate

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

Source from the content-addressed store, hash-verified

318}
319
320func (s *Server) BuildUpdate(c *stdapi.Context) error {
321 if err := s.hook("BuildUpdateValidate", c); err != nil {
322 return err
323 }
324
325 app := c.Var("app")
326 id := c.Var("id")
327
328 var opts structs.BuildUpdateOptions
329 if err := stdapi.UnmarshalOptions(c.Request(), &opts); err != nil {
330 return err
331 }
332
333 v, err := s.provider(c).WithContext(c.Context()).BuildUpdate(app, id, opts)
334 if err != nil {
335 return err
336 }
337
338 if vs, ok := interface{}(v).(Sortable); ok {
339 sort.Slice(v, vs.Less)
340 }
341
342 return c.RenderJSON(v)
343}
344
345func (s *Server) CapacityGet(c *stdapi.Context) error {
346 if err := s.hook("CapacityGetValidate", c); err != nil {

Callers

nothing calls this directly

Calls 7

hookMethod · 0.95
providerMethod · 0.95
RequestMethod · 0.80
ContextMethod · 0.80
SliceMethod · 0.80
BuildUpdateMethod · 0.65
WithContextMethod · 0.65

Tested by

no test coverage detected