Skip to content

Commit

Permalink
client: Expose close function (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdamian committed Nov 23, 2022
1 parent 91238f3 commit ccecb66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ type Client interface {
*gethrpc.ClientSubscription, error)

URL() string

Close()
}

type client struct {
Expand All @@ -51,6 +53,10 @@ func (c client) URL() string {
return c.url
}

func (c client) Close() {
c.Client.Close()
}

// Connect connects to the provided url
func Connect(url string) (Client, error) {
log.Printf("Connecting to %v...", url)
Expand Down
5 changes: 5 additions & 0 deletions client/mocks/Client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ccecb66

Please sign in to comment.