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

Method ObjectExists

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

Source from the content-addressed store, hash-verified

630}
631
632func (s *Server) ObjectExists(c *stdapi.Context) error {
633 if err := s.hook("ObjectExistsValidate", c); err != nil {
634 return err
635 }
636
637 app := c.Var("app")
638 key := c.Var("key")
639
640 v, err := s.provider(c).WithContext(c.Context()).ObjectExists(app, key)
641 if err != nil {
642 return err
643 }
644
645 if vs, ok := interface{}(v).(Sortable); ok {
646 sort.Slice(v, vs.Less)
647 }
648
649 return c.RenderJSON(v)
650}
651
652func (s *Server) ObjectFetch(c *stdapi.Context) error {
653 if err := s.hook("ObjectFetchValidate", c); err != nil {

Callers

nothing calls this directly

Calls 6

hookMethod · 0.95
providerMethod · 0.95
ContextMethod · 0.80
SliceMethod · 0.80
ObjectExistsMethod · 0.65
WithContextMethod · 0.65

Tested by

no test coverage detected