(ctx context.Context, _ *rts.ListNamespacesRequest)
| 45 | } |
| 46 | |
| 47 | func (h *Handler) ListNamespaces(ctx context.Context, _ *rts.ListNamespacesRequest) (*rts.ListNamespacesResponse, error) { |
| 48 | m, err := h.Config(ctx).NamespaceManager() |
| 49 | if err != nil { |
| 50 | h.Logger().WithError(err).Errorf("could not get namespace manager") |
| 51 | return nil, herodot.ErrInternalServerError |
| 52 | } |
| 53 | namespaces, err := m.Namespaces(ctx) |
| 54 | if err != nil { |
| 55 | h.Logger().WithError(err).Errorf("could not get namespaces") |
| 56 | return nil, herodot.ErrInternalServerError |
| 57 | } |
| 58 | apiNamespaces := make([]*rts.Namespace, len(namespaces)) |
| 59 | for i, n := range namespaces { |
| 60 | apiNamespaces[i] = &rts.Namespace{Name: n.Name} |
| 61 | } |
| 62 | return &rts.ListNamespacesResponse{Namespaces: apiNamespaces}, nil |
| 63 | } |
| 64 | |
| 65 | // swagger:route GET /namespaces relationship listRelationshipNamespaces |
| 66 | // |
no test coverage detected