Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
feat(BUX-181): move SocketHandler to interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiuszos4chain committed Sep 19, 2023
1 parent 496e498 commit e3b5539
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
19 changes: 19 additions & 0 deletions chainstate/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,22 @@ type MonitorService interface {
Start(ctx context.Context, handler MonitorHandler, onStop func()) error
Stop(ctx context.Context) error
}

// SocketHandler is composite interface of centrifuge handlers interfaces
type SocketHandler interface {
OnConnect(*centrifuge.Client, centrifuge.ConnectEvent)
OnDisconnect(*centrifuge.Client, centrifuge.DisconnectEvent)
OnError(*centrifuge.Client, centrifuge.ErrorEvent)
OnJoin(*centrifuge.Subscription, centrifuge.JoinEvent)
OnLeave(*centrifuge.Subscription, centrifuge.LeaveEvent)
OnMessage(*centrifuge.Client, centrifuge.MessageEvent)
OnPublish(*centrifuge.Subscription, centrifuge.PublishEvent)
OnServerJoin(*centrifuge.Client, centrifuge.ServerJoinEvent)
OnServerLeave(*centrifuge.Client, centrifuge.ServerLeaveEvent)
OnServerPublish(*centrifuge.Client, centrifuge.ServerPublishEvent)
OnServerSubscribe(*centrifuge.Client, centrifuge.ServerSubscribeEvent)
OnServerUnsubscribe(*centrifuge.Client, centrifuge.ServerUnsubscribeEvent)
OnSubscribeError(*centrifuge.Subscription, centrifuge.SubscribeErrorEvent)
OnSubscribeSuccess(*centrifuge.Subscription, centrifuge.SubscribeSuccessEvent)
OnUnsubscribe(*centrifuge.Subscription, centrifuge.UnsubscribeEvent)
}
19 changes: 0 additions & 19 deletions chainstate/monitor_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,3 @@ func newCentrifugeClient(wsURL string, handler SocketHandler) MonitorClient {

return &AgentClient{Client: c}
}

// SocketHandler is composite interface of centrifuge handlers interfaces
type SocketHandler interface {
OnConnect(*centrifuge.Client, centrifuge.ConnectEvent)
OnDisconnect(*centrifuge.Client, centrifuge.DisconnectEvent)
OnError(*centrifuge.Client, centrifuge.ErrorEvent)
OnJoin(*centrifuge.Subscription, centrifuge.JoinEvent)
OnLeave(*centrifuge.Subscription, centrifuge.LeaveEvent)
OnMessage(*centrifuge.Client, centrifuge.MessageEvent)
OnPublish(*centrifuge.Subscription, centrifuge.PublishEvent)
OnServerJoin(*centrifuge.Client, centrifuge.ServerJoinEvent)
OnServerLeave(*centrifuge.Client, centrifuge.ServerLeaveEvent)
OnServerPublish(*centrifuge.Client, centrifuge.ServerPublishEvent)
OnServerSubscribe(*centrifuge.Client, centrifuge.ServerSubscribeEvent)
OnServerUnsubscribe(*centrifuge.Client, centrifuge.ServerUnsubscribeEvent)
OnSubscribeError(*centrifuge.Subscription, centrifuge.SubscribeErrorEvent)
OnSubscribeSuccess(*centrifuge.Subscription, centrifuge.SubscribeSuccessEvent)
OnUnsubscribe(*centrifuge.Subscription, centrifuge.UnsubscribeEvent)
}

0 comments on commit e3b5539

Please sign in to comment.