diff --git a/client.go b/client.go index 711ad0e8..8768d781 100644 --- a/client.go +++ b/client.go @@ -12,7 +12,7 @@ import ( const ( // version is the current version - version = "v0.10.0" + version = "v0.10.1" // defaultUserAgent is the default user agent for all requests defaultUserAgent string = "go-whatsonchain: " + version diff --git a/client_test.go b/client_test.go index 5061b4f2..8d1859c8 100644 --- a/client_test.go +++ b/client_test.go @@ -55,7 +55,7 @@ func TestNewClient_CustomHTTPClient(t *testing.T) { func ExampleNewClient() { client := NewClient(NetworkTest, nil, nil) fmt.Println(client.UserAgent()) - // Output:go-whatsonchain: v0.10.0 + // Output:go-whatsonchain: v0.10.1 } // BenchmarkNewClient benchmarks the NewClient method diff --git a/interface.go b/interface.go index 371303d4..3eb8fc1a 100644 --- a/interface.go +++ b/interface.go @@ -76,7 +76,7 @@ type TransactionService interface { // WebsocketService is the WhatsOnCHain websocket related clients type WebsocketService interface { - NewMempoolWebsocket(handler socketHandler) *centrifuge.Client + NewMempoolWebsocket(handler SocketHandler) *centrifuge.Client } // ClientInterface is the WhatsOnChain client interface diff --git a/websocket.go b/websocket.go index a845fea0..7f624423 100644 --- a/websocket.go +++ b/websocket.go @@ -8,22 +8,22 @@ const ( socketEndpointMempool = "mempool" ) -// socketHandler describe the interface -type socketHandler interface { +// SocketHandler describe the interface +type SocketHandler interface { OnConnect(*centrifuge.Client, centrifuge.ConnectEvent) - OnError(*centrifuge.Client, centrifuge.ErrorEvent) OnDisconnect(*centrifuge.Client, centrifuge.DisconnectEvent) + OnError(*centrifuge.Client, centrifuge.ErrorEvent) OnMessage(*centrifuge.Client, centrifuge.MessageEvent) OnServerPublish(*centrifuge.Client, centrifuge.ServerPublishEvent) } // NewMempoolWebsocket instantiates a new websocket client to stream mempool transactions -func (c *Client) NewMempoolWebsocket(handler socketHandler) *centrifuge.Client { +func (c *Client) NewMempoolWebsocket(handler SocketHandler) *centrifuge.Client { return newWebsocketClient(socketEndpoint+socketEndpointMempool, handler) } // newWebsocketClient will create a new websocket client -func newWebsocketClient(url string, handler socketHandler) (client *centrifuge.Client) { +func newWebsocketClient(url string, handler SocketHandler) (client *centrifuge.Client) { if url == "" || handler == nil { return } diff --git a/websocket_test.go b/websocket_test.go index 9f255c75..f2e5c774 100644 --- a/websocket_test.go +++ b/websocket_test.go @@ -30,7 +30,7 @@ func (h *testHandler) OnError(_ *centrifuge.Client, _ centrifuge.ErrorEvent) { func TestClient_NewMempoolWebsocket(t *testing.T) { type args struct { - handler socketHandler + handler SocketHandler } tests := []struct { name string @@ -55,7 +55,7 @@ func TestClient_NewMempoolWebsocket(t *testing.T) { func Test_newWebsocketClient(t *testing.T) { type args struct { url string - handler socketHandler + handler SocketHandler } tests := []struct { name string