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

Method RegistryAdd

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

Source from the content-addressed store, hash-verified

893}
894
895func (s *Server) RegistryAdd(c *stdapi.Context) error {
896 if err := s.hook("RegistryAddValidate", c); err != nil {
897 return err
898 }
899
900 server := c.Value("server")
901 username := c.Value("username")
902 password := c.Value("password")
903
904 v, err := s.provider(c).WithContext(c.Context()).RegistryAdd(server, username, password)
905 if err != nil {
906 return err
907 }
908
909 if vs, ok := interface{}(v).(Sortable); ok {
910 sort.Slice(v, vs.Less)
911 }
912
913 return c.RenderJSON(v)
914}
915
916func (s *Server) RegistryList(c *stdapi.Context) error {
917 if err := s.hook("RegistryListValidate", c); err != nil {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected