MCPcopy Create free account
hub / github.com/apache/kvrocks-controller / ListNamespace

Method ListNamespace

store/store.go:76–86  ·  view source on GitHub ↗

ListNamespace return the list of name of all namespaces

(ctx context.Context)

Source from the content-addressed store, hash-verified

74
75// ListNamespace return the list of name of all namespaces
76func (s *ClusterStore) ListNamespace(ctx context.Context) ([]string, error) {
77 entries, err := s.e.List(ctx, nsPrefix)
78 if err != nil {
79 return nil, err
80 }
81 keys := make([]string, len(entries))
82 for i, entry := range entries {
83 keys[i] = entry.Key
84 }
85 return keys, nil
86}
87
88// ExistsNamespace return an indicator whether the specified namespace exists
89func (s *ClusterStore) ExistsNamespace(ctx context.Context, ns string) (bool, error) {

Callers 2

CheckNewNodesMethod · 0.95
TestClusterStoreFunction · 0.95

Calls 1

ListMethod · 0.65

Tested by 1

TestClusterStoreFunction · 0.76