Skip to content

Commit

Permalink
get all keyspaces
Browse files Browse the repository at this point in the history
Signed-off-by: ystaticy <[email protected]>
  • Loading branch information
ystaticy committed Jul 13, 2023
1 parent 69e48d4 commit 44d4466
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client/keyspace_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ type KeyspaceClient interface {
LoadKeyspace(ctx context.Context, name string) (*keyspacepb.KeyspaceMeta, error)
// UpdateKeyspaceState updates target keyspace's state.
UpdateKeyspaceState(ctx context.Context, id uint32, state keyspacepb.KeyspaceState) (*keyspacepb.KeyspaceMeta, error)
// WatchKeyspaces watches keyspace meta changes.
WatchKeyspaces(ctx context.Context) (chan []*keyspacepb.KeyspaceMeta, error)
// GetAllKeyspaces get all keyspace's metadata.
GetAllKeyspaces(ctx context.Context, startID uint32, limit uint32) ([]*keyspacepb.KeyspaceMeta, error)
}
Expand Down Expand Up @@ -114,6 +116,14 @@ func (c *client) UpdateKeyspaceState(ctx context.Context, id uint32, state keysp
return resp.Keyspace, nil
}

// WatchKeyspaces watches keyspace meta changes.
// It returns a stream of slices of keyspace metadata.
// The first message in stream contains all current keyspaceMeta,
// all subsequent messages contains new put events for all keyspaces.
func (c *client) WatchKeyspaces(ctx context.Context) (chan []*keyspacepb.KeyspaceMeta, error) {
return nil, errors.Errorf("WatchKeyspaces unimplemented")
}

// GetAllKeyspaces get all keyspaces metadata.
func (c *client) GetAllKeyspaces(ctx context.Context, startID uint32, limit uint32) ([]*keyspacepb.KeyspaceMeta, error) {
if span := opentracing.SpanFromContext(ctx); span != nil {
Expand Down

0 comments on commit 44d4466

Please sign in to comment.