Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
add DriverFromClient constructor
Browse files Browse the repository at this point in the history
Signed-off-by: lwsanty <[email protected]>
  • Loading branch information
lwsanty authored and dennwc committed Nov 14, 2019
1 parent 36bfb4c commit 37abd69
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions protocol/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,13 @@ func RegisterDriver(srv *grpc.Server, d driver.Driver) {

// AsDriver creates a v2 driver client for a given gRPC client.
func AsDriver(cc *grpc.ClientConn) driver.Driver {
return DriverFromClient(NewDriverClient(cc), NewDriverHostClient(cc))
}

func DriverFromClient(c DriverClient, h DriverHostClient) driver.Driver {
return &client{
c: NewDriverClient(cc),
h: NewDriverHostClient(cc),
c: c,
h: h,
}
}

Expand Down

0 comments on commit 37abd69

Please sign in to comment.