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

Method ResourceGet

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

Source from the content-addressed store, hash-verified

1035}
1036
1037func (s *Server) ResourceGet(c *stdapi.Context) error {
1038 if err := s.hook("ResourceGetValidate", c); err != nil {
1039 return err
1040 }
1041
1042 app := c.Var("app")
1043 name := c.Var("name")
1044
1045 v, err := s.provider(c).WithContext(c.Context()).ResourceGet(app, name)
1046 if err != nil {
1047 return err
1048 }
1049
1050 if vs, ok := interface{}(v).(Sortable); ok {
1051 sort.Slice(v, vs.Less)
1052 }
1053
1054 return c.RenderJSON(v)
1055}
1056
1057func (s *Server) ResourceList(c *stdapi.Context) error {
1058 if err := s.hook("ResourceListValidate", c); err != nil {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected