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

Method BuildCreate

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

Source from the content-addressed store, hash-verified

179}
180
181func (s *Server) BuildCreate(c *stdapi.Context) error {
182 if err := s.hook("BuildCreateValidate", c); err != nil {
183 return err
184 }
185
186 app := c.Var("app")
187 url := c.Value("url")
188
189 var opts structs.BuildCreateOptions
190 if err := stdapi.UnmarshalOptions(c.Request(), &opts); err != nil {
191 return err
192 }
193
194 v, err := s.provider(c).WithContext(c.Context()).BuildCreate(app, url, opts)
195 if err != nil {
196 return err
197 }
198
199 if vs, ok := interface{}(v).(Sortable); ok {
200 sort.Slice(v, vs.Less)
201 }
202
203 return c.RenderJSON(v)
204}
205
206func (s *Server) BuildExport(c *stdapi.Context) error {
207 if err := s.hook("BuildExportValidate", 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
BuildCreateMethod · 0.65
WithContextMethod · 0.65

Tested by

no test coverage detected