Skip to content

Commit

Permalink
streamclient: rename client to mockClient
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
pbardea committed Jan 22, 2021
1 parent baf8928 commit 23dbf05
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/ccl/streamingccl/streamclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func NewStreamClient(streamAddress streamingccl.StreamAddress) (Client, error) {
return streamClient, err
}
default:
streamClient = &client{}
streamClient = &mockClient{}
}

return streamClient, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/streamingccl/streamclient/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func TestImplementationsCloseChannel(t *testing.T) {

// TODO: Add SQL client and file client here when implemented.
impls := []Client{
&client{},
&mockClient{},
randomClient,
}

Expand Down
10 changes: 5 additions & 5 deletions pkg/ccl/streamingccl/streamclient/stream_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ import (
"github.com/cockroachdb/cockroach/pkg/ccl/streamingccl"
)

// client is a mock stream client.
type client struct{}
// mockClient is a mock stream client.
type mockClient struct{}

var _ Client = &client{}
var _ Client = &mockClient{}

// GetTopology implements the Client interface.
func (m *client) GetTopology(_ streamingccl.StreamAddress) (streamingccl.Topology, error) {
func (m *mockClient) GetTopology(_ streamingccl.StreamAddress) (streamingccl.Topology, error) {
return streamingccl.Topology{
Partitions: []streamingccl.PartitionAddress{"some://address"},
}, nil
}

// ConsumePartition implements the Client interface.
func (m *client) ConsumePartition(
func (m *mockClient) ConsumePartition(
ctx context.Context, _ streamingccl.PartitionAddress, _ time.Time,
) (chan streamingccl.Event, error) {
eventCh := make(chan streamingccl.Event)
Expand Down

0 comments on commit 23dbf05

Please sign in to comment.