(ctx context.Context, req *api.ListNamespacesRequest, _ ...grpc.CallOption)
| 94 | } |
| 95 | |
| 96 | func (l *local) List(ctx context.Context, req *api.ListNamespacesRequest, _ ...grpc.CallOption) (*api.ListNamespacesResponse, error) { |
| 97 | var resp api.ListNamespacesResponse |
| 98 | |
| 99 | return &resp, l.withStoreView(ctx, func(ctx context.Context, store namespaces.Store) error { |
| 100 | namespaces, err := store.List(ctx) |
| 101 | if err != nil { |
| 102 | return err |
| 103 | } |
| 104 | |
| 105 | for _, namespace := range namespaces { |
| 106 | labels, err := store.Labels(ctx, namespace) |
| 107 | if err != nil { |
| 108 | // In general, this should be unlikely, since we are holding a |
| 109 | // transaction to service this request. |
| 110 | return errgrpc.ToGRPC(err) |
| 111 | } |
| 112 | |
| 113 | resp.Namespaces = append(resp.Namespaces, &api.Namespace{ |
| 114 | Name: namespace, |
| 115 | Labels: labels, |
| 116 | }) |
| 117 | } |
| 118 | |
| 119 | return nil |
| 120 | }) |
| 121 | } |
| 122 | |
| 123 | func (l *local) Create(ctx context.Context, req *api.CreateNamespaceRequest, _ ...grpc.CallOption) (*api.CreateNamespaceResponse, error) { |
| 124 | var resp api.CreateNamespaceResponse |
nothing calls this directly
no test coverage detected