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

Method AppCreate

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

Source from the content-addressed store, hash-verified

28}
29
30func (s *Server) AppCreate(c *stdapi.Context) error {
31 if err := s.hook("AppCreateValidate", c); err != nil {
32 return err
33 }
34
35 name := c.Value("name")
36
37 var opts structs.AppCreateOptions
38 if err := stdapi.UnmarshalOptions(c.Request(), &opts); err != nil {
39 return err
40 }
41
42 v, err := s.provider(c).WithContext(c.Context()).AppCreate(name, opts)
43 if err != nil {
44 return err
45 }
46
47 if vs, ok := interface{}(v).(Sortable); ok {
48 sort.Slice(v, vs.Less)
49 }
50
51 return c.RenderJSON(v)
52}
53
54func (s *Server) AppDelete(c *stdapi.Context) error {
55 if err := s.hook("AppDeleteValidate", 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
AppCreateMethod · 0.65
WithContextMethod · 0.65

Tested by

no test coverage detected